提交 74641d75 编写于 作者: A Adrian Hunter 提交者: David Woodhouse

[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: NAdrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
上级 f8a922c7
...@@ -200,6 +200,11 @@ static int part_erase (struct mtd_info *mtd, struct erase_info *instr) ...@@ -200,6 +200,11 @@ static int part_erase (struct mtd_info *mtd, struct erase_info *instr)
return -EINVAL; return -EINVAL;
instr->addr += part->offset; instr->addr += part->offset;
ret = part->master->erase(part->master, instr); ret = part->master->erase(part->master, instr);
if (ret) {
if (instr->fail_addr != 0xffffffff)
instr->fail_addr -= part->offset;
instr->addr -= part->offset;
}
return ret; return ret;
} }
...@@ -560,4 +565,3 @@ EXPORT_SYMBOL_GPL(deregister_mtd_parser); ...@@ -560,4 +565,3 @@ EXPORT_SYMBOL_GPL(deregister_mtd_parser);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR("Nicolas Pitre <nico@cam.org>"); MODULE_AUTHOR("Nicolas Pitre <nico@cam.org>");
MODULE_DESCRIPTION("Generic support for partitioning of MTD devices"); MODULE_DESCRIPTION("Generic support for partitioning of MTD devices");
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册