summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdcore.c
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@bootlin.com>2018-02-12 22:03:09 +0100
committerBoris Brezillon <boris.brezillon@bootlin.com>2018-03-15 18:21:07 +0100
commit884cfd9023ce6afe8bcf181ec988d8516eb32bf0 (patch)
treef57f5eafe52a568ac90e25b64f8e6a0e9d37e993 /drivers/mtd/mtdcore.c
parentdcba51bbb9e0cc7f80d36eb20a033a4dff2ce9cc (diff)
downloadop-kernel-dev-884cfd9023ce6afe8bcf181ec988d8516eb32bf0.zip
op-kernel-dev-884cfd9023ce6afe8bcf181ec988d8516eb32bf0.tar.gz
mtd: Stop assuming mtd_erase() is asynchronous
None of the mtd->_erase() implementations work in an asynchronous manner, so let's simplify MTD users that call mtd_erase(). All they need to do is check the value returned by mtd_erase() and assume that != 0 means failure. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers/mtd/mtdcore.c')
-rw-r--r--drivers/mtd/mtdcore.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index c87859f..f92ad02 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -945,11 +945,9 @@ void __put_mtd_device(struct mtd_info *mtd)
EXPORT_SYMBOL_GPL(__put_mtd_device);
/*
- * Erase is an asynchronous operation. Device drivers are supposed
- * to call instr->callback() whenever the operation completes, even
- * if it completes with a failure.
- * Callers are supposed to pass a callback function and wait for it
- * to be called before writing to the block.
+ * Erase is an synchronous operation. Device drivers are epected to return a
+ * negative error code if the operation failed and update instr->fail_addr
+ * to point the portion that was not properly erased.
*/
int mtd_erase(struct mtd_info *mtd, struct erase_info *instr)
{
OpenPOWER on IntegriCloud