struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
        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);