diff options
author | Scott Wood <oss@buserror.net> | 2016-05-30 13:57:54 -0500 |
---|---|---|
committer | Scott Wood <oss@buserror.net> | 2016-06-03 20:27:48 -0500 |
commit | 151c06ec61d74b77cf27d6d622bab6370c949c66 (patch) | |
tree | fc50effb6cd876bf28ba3e6f3f143f0f51fd6db1 /fs | |
parent | ea7d1eec66898b233ac49f8a60391b96afa25477 (diff) | |
download | u-boot-imx-151c06ec61d74b77cf27d6d622bab6370c949c66.zip u-boot-imx-151c06ec61d74b77cf27d6d622bab6370c949c66.tar.gz u-boot-imx-151c06ec61d74b77cf27d6d622bab6370c949c66.tar.bz2 |
mtd: nand: Remove nand_info_t typedef
This typedef serves no purpose other than causing confusion with
struct nand_chip.
Signed-off-by: Scott Wood <oss@buserror.net>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/jffs2/jffs2_nand_1pass.c | 24 | ||||
-rw-r--r-- | fs/yaffs2/yaffs_uboot_glue.c | 2 |
2 files changed, 14 insertions, 12 deletions
diff --git a/fs/jffs2/jffs2_nand_1pass.c b/fs/jffs2/jffs2_nand_1pass.c index 740f787..9b7af09 100644 --- a/fs/jffs2/jffs2_nand_1pass.c +++ b/fs/jffs2/jffs2_nand_1pass.c @@ -23,7 +23,7 @@ # define DEBUGF(fmt,args...) #endif -static nand_info_t *nand; +static struct mtd_info *mtd; /* Compression names */ static char *compr_names[] = { @@ -304,7 +304,7 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 ino, char *dest, len = sizeof(struct jffs2_raw_inode); if (dest) len += jNode->csize; - nand_read(nand, jNode->offset, &len, inode); + nand_read(mtd, jNode->offset, &len, inode); /* ignore data behind latest known EOF */ if (inode->offset > totalSize) continue; @@ -450,7 +450,7 @@ dump_inode(struct b_lists *pL, struct b_dirent *d, struct b_inode *i) if(!d || !i) return -1; len = d->nsize; - nand_read(nand, d->offset + sizeof(struct jffs2_raw_dirent), + nand_read(mtd, d->offset + sizeof(struct jffs2_raw_dirent), &len, &fname); fname[d->nsize] = '\0'; @@ -592,7 +592,9 @@ jffs2_1pass_resolve_inode(struct b_lists * pL, u32 ino) for (jNode = (struct b_inode *)pL->frag.listHead; jNode; jNode = jNode->next) { if (jNode->ino == jDirFoundIno) { size_t len = jNode->csize; - nand_read(nand, jNode->offset + sizeof(struct jffs2_raw_inode), &len, &tmp); + nand_read(mtd, + jNode->offset + sizeof(struct jffs2_raw_inode), + &len, &tmp); tmp[jNode->csize] = '\0'; break; } @@ -760,14 +762,14 @@ dump_dirents(struct b_lists *pL) #endif static int -jffs2_fill_scan_buf(nand_info_t *nand, unsigned char *buf, +jffs2_fill_scan_buf(struct mtd_info *mtd, unsigned char *buf, unsigned ofs, unsigned len) { int ret; unsigned olen; olen = len; - ret = nand_read(nand, ofs, &olen, buf); + ret = nand_read(mtd, ofs, &olen, buf); if (ret) { printf("nand_read(0x%x bytes from 0x%x) returned %d\n", len, ofs, ret); return ret; @@ -794,7 +796,7 @@ jffs2_1pass_build_lists(struct part_info * part) u32 counterN = 0; struct mtdids *id = part->dev->id; - nand = nand_info + id->num; + mtd = nand_info + id->num; /* if we are building a list we need to refresh the cache. */ jffs_init_1pass_list(part); @@ -802,7 +804,7 @@ jffs2_1pass_build_lists(struct part_info * part) pL->partOffset = part->offset; puts ("Scanning JFFS2 FS: "); - sectorsize = nand->erasesize; + sectorsize = mtd->erasesize; nr_blocks = part->size / sectorsize; buf = malloc(sectorsize); if (!buf) @@ -813,10 +815,10 @@ jffs2_1pass_build_lists(struct part_info * part) offset = part->offset + i * sectorsize; - if (nand_block_isbad(nand, offset)) + if (nand_block_isbad(mtd, offset)) continue; - if (jffs2_fill_scan_buf(nand, buf, offset, EMPTY_SCAN_SIZE)) + if (jffs2_fill_scan_buf(mtd, buf, offset, EMPTY_SCAN_SIZE)) return 0; ofs = 0; @@ -826,7 +828,7 @@ jffs2_1pass_build_lists(struct part_info * part) if (ofs == EMPTY_SCAN_SIZE) continue; - if (jffs2_fill_scan_buf(nand, buf + EMPTY_SCAN_SIZE, offset + EMPTY_SCAN_SIZE, sectorsize - EMPTY_SCAN_SIZE)) + if (jffs2_fill_scan_buf(mtd, buf + EMPTY_SCAN_SIZE, offset + EMPTY_SCAN_SIZE, sectorsize - EMPTY_SCAN_SIZE)) return 0; offset += ofs; diff --git a/fs/yaffs2/yaffs_uboot_glue.c b/fs/yaffs2/yaffs_uboot_glue.c index 50000a1..5e99025 100644 --- a/fs/yaffs2/yaffs_uboot_glue.c +++ b/fs/yaffs2/yaffs_uboot_glue.c @@ -141,7 +141,7 @@ static const char *yaffs_error_str(void) } } -extern nand_info_t nand_info[]; +extern struct mtd_info nand_info[]; void cmd_yaffs_tracemask(unsigned set, unsigned mask) { |