aboutsummaryrefslogtreecommitdiff
path: root/fs/jffs2/jffs2_nand_1pass.c
diff options
context:
space:
mode:
authorGrygorii Strashko <grygorii.strashko@ti.com>2017-06-26 19:12:57 -0500
committerTom Rini <trini@konsulko.com>2017-07-11 22:41:47 -0400
commiteb6a5c3c020099bbbc41cf3509718828ec1733cc (patch)
tree149864980c596e579d634f2eb7a5ae58f623f6a4 /fs/jffs2/jffs2_nand_1pass.c
parentedba8cc4f363112597466909e99b20a3b4469447 (diff)
downloadu-boot-eb6a5c3c020099bbbc41cf3509718828ec1733cc.zip
u-boot-eb6a5c3c020099bbbc41cf3509718828ec1733cc.tar.gz
u-boot-eb6a5c3c020099bbbc41cf3509718828ec1733cc.tar.bz2
fs: use get_nand_dev_by_index()
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>
Diffstat (limited to 'fs/jffs2/jffs2_nand_1pass.c')
-rw-r--r--fs/jffs2/jffs2_nand_1pass.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/jffs2/jffs2_nand_1pass.c b/fs/jffs2/jffs2_nand_1pass.c
index d94c48f..1d63fc9 100644
--- a/fs/jffs2/jffs2_nand_1pass.c
+++ b/fs/jffs2/jffs2_nand_1pass.c
@@ -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);