diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-23 10:30:16 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:25:19 -0500 |
commit | 329ad399a9b3adf52c90637b21ca029fcf7f8795 (patch) | |
tree | 7aa7bb2609c25de7859c3a666f3ea90934609592 /fs/jffs2 | |
parent | 04c601bfa4cb29c968dcb66e44c799c9c01d8675 (diff) |
mtd: introduce mtd_read interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'fs/jffs2')
-rw-r--r-- | fs/jffs2/erase.c | 2 | ||||
-rw-r--r-- | fs/jffs2/wbuf.c | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c index ffdf4fca9c54..c59d642cade2 100644 --- a/fs/jffs2/erase.c +++ b/fs/jffs2/erase.c | |||
@@ -381,7 +381,7 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl | |||
381 | 381 | ||
382 | *bad_offset = ofs; | 382 | *bad_offset = ofs; |
383 | 383 | ||
384 | ret = c->mtd->read(c->mtd, ofs, readlen, &retlen, ebuf); | 384 | ret = mtd_read(c->mtd, ofs, readlen, &retlen, ebuf); |
385 | if (ret) { | 385 | if (ret) { |
386 | printk(KERN_WARNING "Read of newly-erased block at 0x%08x failed: %d. Putting on bad_list\n", ofs, ret); | 386 | printk(KERN_WARNING "Read of newly-erased block at 0x%08x failed: %d. Putting on bad_list\n", ofs, ret); |
387 | ret = -EIO; | 387 | ret = -EIO; |
diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c index b09e51d2f81f..a24d3d21b63d 100644 --- a/fs/jffs2/wbuf.c +++ b/fs/jffs2/wbuf.c | |||
@@ -228,7 +228,7 @@ static int jffs2_verify_write(struct jffs2_sb_info *c, unsigned char *buf, | |||
228 | size_t retlen; | 228 | size_t retlen; |
229 | char *eccstr; | 229 | char *eccstr; |
230 | 230 | ||
231 | ret = c->mtd->read(c->mtd, ofs, c->wbuf_pagesize, &retlen, c->wbuf_verify); | 231 | ret = mtd_read(c->mtd, ofs, c->wbuf_pagesize, &retlen, c->wbuf_verify); |
232 | if (ret && ret != -EUCLEAN && ret != -EBADMSG) { | 232 | if (ret && ret != -EUCLEAN && ret != -EBADMSG) { |
233 | printk(KERN_WARNING "jffs2_verify_write(): Read back of page at %08x failed: %d\n", c->wbuf_ofs, ret); | 233 | printk(KERN_WARNING "jffs2_verify_write(): Read back of page at %08x failed: %d\n", c->wbuf_ofs, ret); |
234 | return ret; | 234 | return ret; |
@@ -337,7 +337,8 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c) | |||
337 | } | 337 | } |
338 | 338 | ||
339 | /* Do the read... */ | 339 | /* Do the read... */ |
340 | ret = c->mtd->read(c->mtd, start, c->wbuf_ofs - start, &retlen, buf); | 340 | ret = mtd_read(c->mtd, start, c->wbuf_ofs - start, &retlen, |
341 | buf); | ||
341 | 342 | ||
342 | /* ECC recovered ? */ | 343 | /* ECC recovered ? */ |
343 | if ((ret == -EUCLEAN || ret == -EBADMSG) && | 344 | if ((ret == -EUCLEAN || ret == -EBADMSG) && |
@@ -948,11 +949,11 @@ int jffs2_flash_read(struct jffs2_sb_info *c, loff_t ofs, size_t len, size_t *re | |||
948 | int ret; | 949 | int ret; |
949 | 950 | ||
950 | if (!jffs2_is_writebuffered(c)) | 951 | if (!jffs2_is_writebuffered(c)) |
951 | return c->mtd->read(c->mtd, ofs, len, retlen, buf); | 952 | return mtd_read(c->mtd, ofs, len, retlen, buf); |
952 | 953 | ||
953 | /* Read flash */ | 954 | /* Read flash */ |
954 | down_read(&c->wbuf_sem); | 955 | down_read(&c->wbuf_sem); |
955 | ret = c->mtd->read(c->mtd, ofs, len, retlen, buf); | 956 | ret = mtd_read(c->mtd, ofs, len, retlen, buf); |
956 | 957 | ||
957 | if ( (ret == -EBADMSG || ret == -EUCLEAN) && (*retlen == len) ) { | 958 | if ( (ret == -EBADMSG || ret == -EUCLEAN) && (*retlen == len) ) { |
958 | if (ret == -EBADMSG) | 959 | if (ret == -EBADMSG) |