diff options
Diffstat (limited to 'fs/jffs2/erase.c')
-rw-r--r-- | fs/jffs2/erase.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c index e513f1913c15..a01cdad6aad1 100644 --- a/fs/jffs2/erase.c +++ b/fs/jffs2/erase.c | |||
@@ -74,7 +74,7 @@ static void jffs2_erase_block(struct jffs2_sb_info *c, | |||
74 | ((struct erase_priv_struct *)instr->priv)->jeb = jeb; | 74 | ((struct erase_priv_struct *)instr->priv)->jeb = jeb; |
75 | ((struct erase_priv_struct *)instr->priv)->c = c; | 75 | ((struct erase_priv_struct *)instr->priv)->c = c; |
76 | 76 | ||
77 | ret = c->mtd->erase(c->mtd, instr); | 77 | ret = mtd_erase(c->mtd, instr); |
78 | if (!ret) | 78 | if (!ret) |
79 | return; | 79 | return; |
80 | 80 | ||
@@ -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 = c->mtd->point(c->mtd, jeb->offset, c->sector_size, | ||
344 | &retlen, &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; |
@@ -349,7 +348,7 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl | |||
349 | if (retlen < c->sector_size) { | 348 | if (retlen < c->sector_size) { |
350 | /* Don't muck about if it won't let us point to the whole erase sector */ | 349 | /* Don't muck about if it won't let us point to the whole erase sector */ |
351 | D1(printk(KERN_DEBUG "MTD point returned len too short: 0x%zx\n", retlen)); | 350 | D1(printk(KERN_DEBUG "MTD point returned len too short: 0x%zx\n", retlen)); |
352 | c->mtd->unpoint(c->mtd, jeb->offset, retlen); | 351 | mtd_unpoint(c->mtd, jeb->offset, retlen); |
353 | goto do_flash_read; | 352 | goto do_flash_read; |
354 | } | 353 | } |
355 | wordebuf = ebuf-sizeof(*wordebuf); | 354 | wordebuf = ebuf-sizeof(*wordebuf); |
@@ -358,7 +357,7 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl | |||
358 | if (*++wordebuf != ~0) | 357 | if (*++wordebuf != ~0) |
359 | break; | 358 | break; |
360 | } while(--retlen); | 359 | } while(--retlen); |
361 | c->mtd->unpoint(c->mtd, jeb->offset, c->sector_size); | 360 | mtd_unpoint(c->mtd, jeb->offset, c->sector_size); |
362 | if (retlen) { | 361 | if (retlen) { |
363 | printk(KERN_WARNING "Newly-erased block contained word 0x%lx at offset 0x%08tx\n", | 362 | printk(KERN_WARNING "Newly-erased block contained word 0x%lx at offset 0x%08tx\n", |
364 | *wordebuf, jeb->offset + c->sector_size-retlen*sizeof(*wordebuf)); | 363 | *wordebuf, jeb->offset + c->sector_size-retlen*sizeof(*wordebuf)); |
@@ -381,7 +380,7 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl | |||
381 | 380 | ||
382 | *bad_offset = ofs; | 381 | *bad_offset = ofs; |
383 | 382 | ||
384 | ret = c->mtd->read(c->mtd, ofs, readlen, &retlen, ebuf); | 383 | ret = mtd_read(c->mtd, ofs, readlen, &retlen, ebuf); |
385 | if (ret) { | 384 | if (ret) { |
386 | printk(KERN_WARNING "Read of newly-erased block at 0x%08x failed: %d. Putting on bad_list\n", ofs, ret); | 385 | printk(KERN_WARNING "Read of newly-erased block at 0x%08x failed: %d. Putting on bad_list\n", ofs, ret); |
387 | ret = -EIO; | 386 | ret = -EIO; |