diff options
author | Grygorii Strashko <grygorii.strashko@ti.com> | 2017-06-26 19:12:55 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-07-11 22:41:46 -0400 |
commit | bfdba68eac662bd5cf1a423aec91fce35ee40312 (patch) | |
tree | 07d9cb9d0472d82377095b974bc6360ce3cf5663 /cmd | |
parent | f370b515108987a14e8fa5bfafe25a4f26e1d298 (diff) | |
download | u-boot-bfdba68eac662bd5cf1a423aec91fce35ee40312.zip u-boot-bfdba68eac662bd5cf1a423aec91fce35ee40312.tar.gz u-boot-bfdba68eac662bd5cf1a423aec91fce35ee40312.tar.bz2 |
cmd: jffs2: 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 'cmd')
-rw-r--r-- | cmd/jffs2.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd/jffs2.c b/cmd/jffs2.c index 9be198e..dc94705 100644 --- a/cmd/jffs2.c +++ b/cmd/jffs2.c @@ -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; } @@ -244,7 +245,7 @@ static inline u32 get_part_sector_size_nand(struct mtdids *id) #if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND) struct mtd_info *mtd; - mtd = nand_info[id->num]; + mtd = get_nand_dev_by_index(id->num); return mtd->erasesize; #else |