]> git.ipfire.org Git - thirdparty/u-boot.git/blobdiff - fs/jffs2/jffs2_nand_1pass.c
fs: use get_nand_dev_by_index()
[thirdparty/u-boot.git] / fs / jffs2 / jffs2_nand_1pass.c
index d94c48f534b4cd8ed2340df5076a38d6f96b076c..1d63fc94340ee8879e9c12814f33fbcca9b9a2f7 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) {
+               error("\nno NAND devices available\n");
+               return 0;
+       }
 
        /* if we are building a list we need to refresh the cache. */
        jffs_init_1pass_list(part);