summaryrefslogtreecommitdiff
path: root/fs/yaffs2
diff options
context:
space:
mode:
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 f663081..bd66d31 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");