]> git.sur5r.net Git - u-boot/blobdiff - cmd/jffs2.c
board: ti: x15: Add support for beagle_X15 revC
[u-boot] / cmd / jffs2.c
index 0b2eefa195436d3e5faaaa428ad2677e83a0e77c..dc94705ccd73ee87b9ee140905957aef99445a47 100644 (file)
@@ -166,8 +166,9 @@ static int mtd_device_validate(u8 type, u8 num, u32 *size)
 #endif
        } else if (type == MTD_DEV_TYPE_NAND) {
 #if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)
-               if (num < CONFIG_SYS_MAX_NAND_DEVICE) {
-                       *size = nand_info[num].size;
+               struct mtd_info *mtd = get_nand_dev_by_index(num);
+               if (mtd) {
+                       *size = mtd->size;
                        return 0;
                }
 
@@ -242,11 +243,11 @@ static int mtd_id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *d
 static inline u32 get_part_sector_size_nand(struct mtdids *id)
 {
 #if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)
-       nand_info_t *nand;
+       struct mtd_info *mtd;
 
-       nand = &nand_info[id->num];
+       mtd = get_nand_dev_by_index(id->num);
 
-       return nand->erasesize;
+       return mtd->erasesize;
 #else
        BUG();
        return 0;
@@ -606,7 +607,7 @@ U_BOOT_CMD(
        "      with offset 'off'"
 );
 U_BOOT_CMD(
-       ls,     2,      1,      do_jffs2_ls,
+       fsls,   2,      1,      do_jffs2_ls,
        "list files in a directory (default /)",
        "[ directory ]"
 );