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>
Esse commit está contido em:
Boris Brezillon
2018-02-12 22:03:09 +01:00
commit 884cfd9023
19 arquivos alterados com 51 adições e 369 exclusões

Ver arquivo

@@ -24,10 +24,6 @@ int mtdtest_erase_eraseblock(struct mtd_info *mtd, unsigned int ebnum)
return err;
}
if (ei.state == MTD_ERASE_FAILED) {
pr_info("some erase error occurred at EB %d\n", ebnum);
return -EIO;
}
return 0;
}

Ver arquivo

@@ -70,12 +70,6 @@ static int multiblock_erase(int ebnum, int blocks)
return err;
}
if (ei.state == MTD_ERASE_FAILED) {
pr_err("some erase error occurred at EB %d,"
"blocks %d\n", ebnum, blocks);
return -EIO;
}
return 0;
}