diff options
author | Boris Brezillon <boris.brezillon@bootlin.com> | 2018-02-12 22:03:11 +0100 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@bootlin.com> | 2018-03-21 09:50:56 +0100 |
commit | e7bfb3fdbde3bfeeeb64e2d73ac6babe59519c9e (patch) | |
tree | f8aaed7657f3b7af86cdf2b5eade135e0f9f740b /drivers/net/ethernet/sfc | |
parent | 8f347c4232d5fc097599b711a3385722a6834005 (diff) | |
download | linux-e7bfb3fdbde3bfeeeb64e2d73ac6babe59519c9e.tar.bz2 |
mtd: Stop updating erase_info->state and calling mtd_erase_callback()
MTD users are no longer checking erase_info->state to determine if the
erase operation failed or succeeded. Moreover, mtd_erase_callback() is
now a NOP.
We can safely get rid of all mtd_erase_callback() calls and all
erase_info->state assignments. While at it, get rid of the
erase_info->state field, all MTD_ERASE_XXX definitions and the
mtd_erase_callback() function.
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Bert Kenward <bkenward@solarflare.com>
---
Changes in v2:
- Address a few coding style issues (reported by Miquel)
- Remove comments that are no longer valid (reported by Miquel)
Diffstat (limited to 'drivers/net/ethernet/sfc')
-rw-r--r-- | drivers/net/ethernet/sfc/falcon/mtd.c | 11 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/mtd.c | 11 |
2 files changed, 2 insertions, 20 deletions
diff --git a/drivers/net/ethernet/sfc/falcon/mtd.c b/drivers/net/ethernet/sfc/falcon/mtd.c index cde593cb1052..2d67e4621a3d 100644 --- a/drivers/net/ethernet/sfc/falcon/mtd.c +++ b/drivers/net/ethernet/sfc/falcon/mtd.c @@ -24,17 +24,8 @@ static int ef4_mtd_erase(struct mtd_info *mtd, struct erase_info *erase) { struct ef4_nic *efx = mtd->priv; - int rc; - rc = efx->type->mtd_erase(mtd, erase->addr, erase->len); - if (rc == 0) { - erase->state = MTD_ERASE_DONE; - } else { - erase->state = MTD_ERASE_FAILED; - erase->fail_addr = MTD_FAIL_ADDR_UNKNOWN; - } - mtd_erase_callback(erase); - return rc; + return efx->type->mtd_erase(mtd, erase->addr, erase->len); } static void ef4_mtd_sync(struct mtd_info *mtd) diff --git a/drivers/net/ethernet/sfc/mtd.c b/drivers/net/ethernet/sfc/mtd.c index a77a8bd2dd70..4ac30b6e5dab 100644 --- a/drivers/net/ethernet/sfc/mtd.c +++ b/drivers/net/ethernet/sfc/mtd.c @@ -24,17 +24,8 @@ static int efx_mtd_erase(struct mtd_info *mtd, struct erase_info *erase) { struct efx_nic *efx = mtd->priv; - int rc; - rc = efx->type->mtd_erase(mtd, erase->addr, erase->len); - if (rc == 0) { - erase->state = MTD_ERASE_DONE; - } else { - erase->state = MTD_ERASE_FAILED; - erase->fail_addr = MTD_FAIL_ADDR_UNKNOWN; - } - mtd_erase_callback(erase); - return rc; + return efx->type->mtd_erase(mtd, erase->addr, erase->len); } static void efx_mtd_sync(struct mtd_info *mtd) |