mtd: nand: drv: use get_nand_dev_by_index()
authorGrygorii Strashko <grygorii.strashko@ti.com>
Tue, 27 Jun 2017 00:13:01 +0000 (19:13 -0500)
committerTom Rini <trini@konsulko.com>
Wed, 12 Jul 2017 02:41:49 +0000 (22:41 -0400)
As part of preparation for nand DM conversion the new API has been
introduced to remove direct access to nand_info array. So, use it here
instead of accessing to nand_info array directly

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
drivers/mtd/nand/fsmc_nand.c
drivers/mtd/nand/zynq_nand.c

index a1f2cba..d5d1056 100644 (file)
@@ -409,7 +409,7 @@ int fsmc_nand_switch_ecc(uint32_t eccstrength)
         * Nomadik SoC is currently supporting this fsmc_nand_switch_ecc()
         * function, as it doesn't need to switch to a different ECC layout.
         */
-       mtd = nand_info[nand_curr_device];
+       mtd = get_nand_dev_by_index(nand_curr_device);
        nand = mtd_to_nand(mtd);
 
        /* Setup the ecc configurations again */
index cb3340d..948f059 100644 (file)
@@ -1008,7 +1008,7 @@ static int zynq_nand_init(struct nand_chip *nand_chip, int devnum)
        }
 
        xnand->nand_base = (void __iomem *)ZYNQ_NAND_BASEADDR;
-       mtd = (struct mtd_info *)&nand_info[0];
+       mtd = get_nand_dev_by_index(0);
 
        nand_chip->priv = xnand;
        mtd->priv = nand_chip;