mtd: nand: orion: use the mtd instance embedded in struct nand_chip

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Jan 12 15:59:22 PST 2016


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=53cd2681e02bee59e433b20934bf71f4db5a87d8
Commit:     53cd2681e02bee59e433b20934bf71f4db5a87d8
Parent:     432420c0fc8d077c30900a4e90779cd7dca021da
Author:     Boris BREZILLON <boris.brezillon at free-electrons.com>
AuthorDate: Thu Dec 10 09:00:17 2015 +0100
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Fri Dec 18 10:54:41 2015 -0800

    mtd: nand: orion: use the mtd instance embedded in struct nand_chip
    
    struct nand_chip now embeds an mtd device. Make use of this mtd instance.
    
    Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/orion_nand.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
index 4ed4f67..087a040 100644
--- a/drivers/mtd/nand/orion_nand.c
+++ b/drivers/mtd/nand/orion_nand.c
@@ -85,11 +85,11 @@ static int __init orion_nand_probe(struct platform_device *pdev)
 	u32 val = 0;
 
 	nc = devm_kzalloc(&pdev->dev,
-			sizeof(struct nand_chip) + sizeof(struct mtd_info),
+			sizeof(struct nand_chip),
 			GFP_KERNEL);
 	if (!nc)
 		return -ENOMEM;
-	mtd = (struct mtd_info *)(nc + 1);
+	mtd = nand_to_mtd(nc);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	io_base = devm_ioremap_resource(&pdev->dev, res);



More information about the linux-mtd-cvs mailing list