diff options
author | Marek BehĂșn <marek.behun@nic.cz> | 2021-10-05 15:56:02 +0200 |
---|---|---|
committer | Jagan Teki <jagan@amarulasolutions.com> | 2021-10-23 15:47:33 +0530 |
commit | 7398c1b758e70708edc1d0aced2e2b07ded1ed7e (patch) | |
tree | d8c2c0b05a9f8d16980bb2c41b751a1e3078636d | |
parent | a67b3719f32673a9890700c72b980acbd2749e49 (diff) | |
download | u-boot-7398c1b758e70708edc1d0aced2e2b07ded1ed7e.tar.gz u-boot-7398c1b758e70708edc1d0aced2e2b07ded1ed7e.tar.bz2 u-boot-7398c1b758e70708edc1d0aced2e2b07ded1ed7e.zip |
mtd: spi-nor-core: Don't check for zero length in spi_nor_write() / spi_nor_erase()
This check is already done in all callers: mtdcore's mtd_write() /
mtd_erase(), legacy spi_nor_write() / spi_flash_erase(). No reason to do
this here as well.
Signed-off-by: Marek BehĂșn <marek.behun@nic.cz>
-rw-r--r-- | drivers/mtd/spi/spi-nor-core.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index 30c54cd7b9..751172d6c9 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -914,9 +914,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; @@ -1671,9 +1668,6 @@ static int spi_nor_write(struct mtd_info *mtd, loff_t to, size_t len, dev_dbg(nor->dev, "to 0x%08x, len %zd\n", (u32)to, len); - if (!len) - return 0; - for (i = 0; i < len; ) { ssize_t written; loff_t addr = to + i; |