aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2011-12-28 08:55:42 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-01-09 13:26:09 -0500
commit10934478e44d9a5a7b16dadd89094fb608cf101e (patch)
tree603d4f5165fc032a28e5efaa872da685eea7bf32 /fs/jffs2
parentfc002e3c320602d0e206f607aca0460540d7637a (diff)
mtd: do use mtd->point directly
Remove direct usage of the "mtd->point" function pointer. Instead, test the mtd_point() return code for '-EOPNOTSUPP'. 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.c9
-rw-r--r--fs/jffs2/readinode.c18
-rw-r--r--fs/jffs2/scan.c2
3 files changed, 13 insertions, 16 deletions
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
index c59d642cade2..a01cdad6aad1 100644
--- a/fs/jffs2/erase.c
+++ b/fs/jffs2/erase.c
@@ -336,12 +336,11 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl
336 uint32_t ofs; 336 uint32_t ofs;
337 size_t retlen; 337 size_t retlen;
338 int ret = -EIO; 338 int ret = -EIO;
339 unsigned long *wordebuf;
339 340
340 if (c->mtd->point) { 341 ret = mtd_point(c->mtd, jeb->offset, c->sector_size, &retlen,
341 unsigned long *wordebuf; 342 &ebuf, NULL);
342 343 if (ret != -EOPNOTSUPP) {
343 ret = mtd_point(c->mtd, jeb->offset, c->sector_size, &retlen,
344 &ebuf, NULL);
345 if (ret) { 344 if (ret) {
346 D1(printk(KERN_DEBUG "MTD point failed %d\n", ret)); 345 D1(printk(KERN_DEBUG "MTD point failed %d\n", ret));
347 goto do_flash_read; 346 goto do_flash_read;
diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c
index fca2f84e1add..3093ac4fb24c 100644
--- a/fs/jffs2/readinode.c
+++ b/fs/jffs2/readinode.c
@@ -62,17 +62,15 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info
62#ifndef __ECOS 62#ifndef __ECOS
63 /* TODO: instead, incapsulate point() stuff to jffs2_flash_read(), 63 /* TODO: instead, incapsulate point() stuff to jffs2_flash_read(),
64 * adding and jffs2_flash_read_end() interface. */ 64 * adding and jffs2_flash_read_end() interface. */
65 if (c->mtd->point) { 65 err = mtd_point(c->mtd, ofs, len, &retlen, (void **)&buffer, NULL);
66 err = mtd_point(c->mtd, ofs, len, &retlen, (void **)&buffer, 66 if (!err && retlen < len) {
67 NULL); 67 JFFS2_WARNING("MTD point returned len too short: %zu instead of %u.\n", retlen, tn->csize);
68 if (!err && retlen < len) { 68 mtd_unpoint(c->mtd, ofs, retlen);
69 JFFS2_WARNING("MTD point returned len too short: %zu instead of %u.\n", retlen, tn->csize); 69 } else if (err) {
70 mtd_unpoint(c->mtd, ofs, retlen); 70 if (err != -EOPNOTSUPP)
71 } else if (err)
72 JFFS2_WARNING("MTD point failed: error code %d.\n", err); 71 JFFS2_WARNING("MTD point failed: error code %d.\n", err);
73 else 72 } else
74 pointed = 1; /* succefully pointed to device */ 73 pointed = 1; /* succefully pointed to device */
75 }
76#endif 74#endif
77 75
78 if (!pointed) { 76 if (!pointed) {
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 83e1665e2574..f99464833bb2 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -105,7 +105,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
105 mtd_unpoint(c->mtd, 0, pointlen); 105 mtd_unpoint(c->mtd, 0, pointlen);
106 flashbuf = NULL; 106 flashbuf = NULL;
107 } 107 }
108 if (ret) 108 if (ret && ret != -EOPNOTSUPP)
109 D1(printk(KERN_DEBUG "MTD point failed %d\n", ret)); 109 D1(printk(KERN_DEBUG "MTD point failed %d\n", ret));
110 } 110 }
111#endif 111#endif