Merge git://git.denx.de/u-boot-fsl-qoriq
[oweals/u-boot.git] / fs / jffs2 / jffs2_nand_1pass.c
index d94c48f534b4cd8ed2340df5076a38d6f96b076c..b16005e6045ffda2cdb6176bd856066be10b1556 100644 (file)
@@ -796,7 +796,11 @@ jffs2_1pass_build_lists(struct part_info * part)
        u32 counterN = 0;
 
        struct mtdids *id = part->dev->id;
-       mtd = nand_info[id->num];
+       mtd = get_nand_dev_by_index(id->num);
+       if (!mtd) {
+               pr_err("\nno NAND devices available\n");
+               return 0;
+       }
 
        /* if we are building a list we need to refresh the cache. */
        jffs_init_1pass_list(part);