diff options
Diffstat (limited to 'fs/yaffs2/yaffs_uboot_glue.c')
-rw-r--r-- | fs/yaffs2/yaffs_uboot_glue.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/yaffs2/yaffs_uboot_glue.c b/fs/yaffs2/yaffs_uboot_glue.c index f6630817d2..bd66d31697 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"); |