]> git.sur5r.net Git - u-boot/commitdiff
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 edb45eb567983b22aa21f2ab5f19f80041d673db..f1c20ff645688769a560bb4a4027b92cadd615ff 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 f8770e0ad8e767bbd7e31cb84311f9310bbd7371..a8a7a66a183e6336493cfd47ec2fef6e1223fb41 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 75e830724c727bf11b3069d7ab2363e46db823e8..a66cfc18877dfaa6837bcee5c69564fcd4bebc1a 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 426202981960be206665abdb6027e1c5d152322d..a7931153315d9ee25d6a993f7ed4ec74e63f58aa 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 a8a3084d033fff4f995b54154c7fa46d85c3763c..ff28df4c19ec9e03a76cb42c2d74f5ddd6a31d19 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 b023e00313b634e73dcb7bde67f6212102446484..60a7607073337954d3e0ea89f38f2fda5f5d2dee 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);