From eb6a5c3c020099bbbc41cf3509718828ec1733cc Mon Sep 17 00:00:00 2001 From: Grygorii Strashko Date: Mon, 26 Jun 2017 19:12:57 -0500 Subject: 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 --- fs/yaffs2/yaffs_uboot_glue.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'fs/yaffs2') 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"); -- cgit v1.2.3