[PATCH RESEND u-boot-spi 5/8] mtd: spi-nor-core: Don't check for zero length in spi_nor_erase()
Marek Behún
marek.behun at nic.cz
Thu Jul 15 01:51:06 CEST 2021
This check is already done in mtdcore's mtd_erase(), no reason to do
this here as well.
Signed-off-by: Marek Behún <marek.behun at nic.cz>
Tested-by: Masami Hiramatsu <masami.hiramatsu at linaro.org>
---
drivers/mtd/spi/spi-nor-core.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
index d8cc1389e3..8ae033c576 100644
--- a/drivers/mtd/spi/spi-nor-core.c
+++ b/drivers/mtd/spi/spi-nor-core.c
@@ -912,9 +912,6 @@ static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr)
dev_dbg(nor->dev, "at 0x%llx, len %lld\n", (long long)instr->addr,
(long long)instr->len);
- if (!instr->len)
- return 0;
-
div_u64_rem(instr->len, mtd->erasesize, &rem);
if (rem)
return -EINVAL;
--
2.31.1
More information about the U-Boot
mailing list