mtd: nand: Patch remaining places where nand_to_mtd() should be used
authorBoris Brezillon <boris.brezillon@free-electrons.com>
Wed, 15 Jun 2016 18:56:10 +0000 (20:56 +0200)
committerScott Wood <oss@buserror.net>
Mon, 20 Jun 2016 00:28:38 +0000 (19:28 -0500)
Some drivers are still directly accessing the chip->mtd field. Patch
them to use nand_to_mtd() instead.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
doc/README.nand
drivers/mtd/nand/am335x_spl_bch.c
drivers/mtd/nand/atmel_nand.c
drivers/mtd/nand/lpc32xx_nand_mlc.c
drivers/mtd/nand/mxs_nand_spl.c
drivers/mtd/nand/nand_spl_simple.c

index edb45eb..f1c20ff 100644 (file)
@@ -137,7 +137,7 @@ Configuration Options:
       init:
 
        /* chip is struct nand_chip, and is now provided by the driver. */
-       mtd = &chip.mtd;
+       mtd = nand_to_mtd(&chip);
 
        /*
         * Fill in appropriate values if this driver uses these fields,
index f8770e0..a8a7a66 100644 (file)
@@ -223,7 +223,7 @@ void nand_init(void)
        /*
         * Init board specific nand support
         */
-       mtd = &nand_chip.mtd;
+       mtd = nand_to_mtd(&nand_chip);
        nand_chip.IO_ADDR_R = nand_chip.IO_ADDR_W =
                (void  __iomem *)CONFIG_SYS_NAND_BASE;
        board_nand_init(&nand_chip);
index 75e8307..a66cfc1 100644 (file)
@@ -1448,7 +1448,7 @@ int board_nand_init(struct nand_chip *nand)
 
 void nand_init(void)
 {
-       mtd = &nand_chip.mtd;
+       mtd = nand_to_mtd(&nand_chip);
        mtd->writesize = CONFIG_SYS_NAND_PAGE_SIZE;
        mtd->oobsize = CONFIG_SYS_NAND_OOBSIZE;
        nand_chip.IO_ADDR_R = (void __iomem *)CONFIG_SYS_NAND_BASE;
index 4262029..a793115 100644 (file)
@@ -541,7 +541,7 @@ static struct nand_chip lpc32xx_chip;
 
 void board_nand_init(void)
 {
-       struct mtd_info *mtd = &lpc32xx_chip.mtd;
+       struct mtd_info *mtd = nand_to_mtd(&lpc32xx_chip);
        int ret;
 
        /* Set all BOARDSPECIFIC (actually core-specific) fields  */
index a8a3084..ff28df4 100644 (file)
@@ -147,7 +147,7 @@ static int mxs_nand_init(void)
 
        /* init mxs nand driver */
        board_nand_init(&nand_chip);
-       mtd = &nand_chip.mtd;
+       mtd = nand_to_mtd(&nand_chip);
        /* set mtd functions */
        nand_chip.cmdfunc = mxs_nand_command;
        nand_chip.numchips = 1;
index b023e00..60a7607 100644 (file)
@@ -249,7 +249,7 @@ void nand_init(void)
        /*
         * Init board specific nand support
         */
-       mtd = &nand_chip.mtd;
+       mtd = nand_to_mtd(&nand_chip);
        nand_chip.IO_ADDR_R = nand_chip.IO_ADDR_W =
                (void  __iomem *)CONFIG_SYS_NAND_BASE;
        board_nand_init(&nand_chip);