struct nand_chip now embeds an mtd device. Patch all drivers to make use
of this mtd instance instead of using the instance embedded in their
private struct or dynamically allocated.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
 #define CE_BIT 12
 
 struct mtd_info_wrapper {
-       struct mtd_info info;
        struct nand_chip chip;
 };
 
 
        /* Get pointer to private data */
        this = &wrapper->chip;
-       crisv32_mtd = &wrapper->info;
+       crisv32_mtd = nand_to_mtd(this);
 
        /* Link the private data with the MTD structure */
        crisv32_mtd->priv = this;
 
 #define BY_BIT 7
 
 struct mtd_info_wrapper {
-       struct mtd_info info;
        struct nand_chip chip;
 };
 
 
        /* Get pointer to private data */
        this = &wrapper->chip;
-       crisv32_mtd = &wrapper->info;
+       crisv32_mtd = nand_to_mtd(this);
 
        pa_oe.oe |= 1 << CE_BIT;
        pa_oe.oe |= 1 << ALE_BIT;