diff options
author | Adrian Hunter <ext-adrian.hunter@nokia.com> | 2007-03-08 05:20:12 -0500 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2007-03-08 05:45:04 -0500 |
commit | 74641d75275936796d239f828b80cb030e9f9b0a (patch) | |
tree | 8364efdc01c453d429db53e24cf2655e69d1f7d5 /drivers/mtd/mtdpart.c | |
parent | f8a922c7bb4d93bd84b7371a8e2571e667d2afb5 (diff) |
[MTD] Correct partition failed erase address
If an erase operation fails, the address at which the
failure occurred is returned by the driver. The MTD
partition must adjust this address (by subtracting the
partition offset) before returning to the caller.
This was not happening, which caused JFFS2 to mark
the wrong block bad!
Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/mtdpart.c')
-rw-r--r-- | drivers/mtd/mtdpart.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 01e4afff42b0..1af989023c66 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c | |||
@@ -200,6 +200,11 @@ static int part_erase (struct mtd_info *mtd, struct erase_info *instr) | |||
200 | return -EINVAL; | 200 | return -EINVAL; |
201 | instr->addr += part->offset; | 201 | instr->addr += part->offset; |
202 | ret = part->master->erase(part->master, instr); | 202 | ret = part->master->erase(part->master, instr); |
203 | if (ret) { | ||
204 | if (instr->fail_addr != 0xffffffff) | ||
205 | instr->fail_addr -= part->offset; | ||
206 | instr->addr -= part->offset; | ||
207 | } | ||
203 | return ret; | 208 | return ret; |
204 | } | 209 | } |
205 | 210 | ||
@@ -560,4 +565,3 @@ EXPORT_SYMBOL_GPL(deregister_mtd_parser); | |||
560 | MODULE_LICENSE("GPL"); | 565 | MODULE_LICENSE("GPL"); |
561 | MODULE_AUTHOR("Nicolas Pitre <nico@cam.org>"); | 566 | MODULE_AUTHOR("Nicolas Pitre <nico@cam.org>"); |
562 | MODULE_DESCRIPTION("Generic support for partitioning of MTD devices"); | 567 | MODULE_DESCRIPTION("Generic support for partitioning of MTD devices"); |
563 | |||