mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-09-21 15:12:04 +00:00
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>
This commit is contained in:
parent
a67b3719f3
commit
7398c1b758
1 changed files with 0 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue