aboutsummaryrefslogtreecommitdiff
path: root/fs/yaffs2
diff options
context:
space:
mode:
authorGrygorii Strashko2017-06-26 19:12:57 -0500
committerTom Rini2017-07-11 22:41:47 -0400
commiteb6a5c3c020099bbbc41cf3509718828ec1733cc (patch)
tree149864980c596e579d634f2eb7a5ae58f623f6a4 /fs/yaffs2
parentedba8cc4f363112597466909e99b20a3b4469447 (diff)
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/yaffs2')
-rw-r--r--fs/yaffs2/yaffs_uboot_glue.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/yaffs2/yaffs_uboot_glue.c b/fs/yaffs2/yaffs_uboot_glue.c
index f6630817d28..bd66d31697f 100644
--- a/fs/yaffs2/yaffs_uboot_glue.c
+++ b/fs/yaffs2/yaffs_uboot_glue.c
@@ -166,11 +166,15 @@ void cmd_yaffs_devconfig(char *_mp, int flash_dev,
char *mp = NULL;
struct nand_chip *chip;
+ mtd = get_nand_dev_by_index(flash_dev);
+ if (!mtd) {
+ error("\nno NAND devices available\n");
+ return;
+ }
+
dev = calloc(1, sizeof(*dev));
mp = strdup(_mp);
- mtd = nand_info[flash_dev];
-
if (!dev || !mp) {
/* Alloc error */
printf("Failed to allocate memory\n");