diff options
| author | [email protected] <[email protected]> | 2017-07-21 13:26:09 +0800 |
|---|---|---|
| committer | Jagan Teki <[email protected]> | 2017-08-08 12:34:27 +0530 |
| commit | 8fc2faefdd8bd950fa6ef615ab63f8ec3b6de7e5 (patch) | |
| tree | 6fa167707889c0b797a880f3929dc0607758c583 | |
| parent | ac6777b1e3362a4958562a3b4315f39db75685f3 (diff) | |
mtd: spi: sf_dataflash: Add print message while erase error
Add the print message to tell us why the erase operation doesn't work.
Signed-off-by: Wenyou Yang <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Reviewed-by: Jagan Teki <[email protected]>
| -rw-r--r-- | drivers/mtd/spi/sf_dataflash.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mtd/spi/sf_dataflash.c b/drivers/mtd/spi/sf_dataflash.c index bcddfa07556..e5c0e12faa3 100644 --- a/drivers/mtd/spi/sf_dataflash.c +++ b/drivers/mtd/spi/sf_dataflash.c @@ -134,11 +134,17 @@ static int spi_dataflash_erase(struct udevice *dev, u32 offset, size_t len) debug("%s: erase addr=0x%x len 0x%x\n", dev->name, offset, len); div_u64_rem(len, spi_flash->page_size, &rem); - if (rem) + if (rem) { + printf("%s: len(0x%x) isn't the multiple of page size(0x%x)\n", + dev->name, len, spi_flash->page_size); return -EINVAL; + } div_u64_rem(offset, spi_flash->page_size, &rem); - if (rem) + if (rem) { + printf("%s: offset(0x%x) isn't the multiple of page size(0x%x)\n", + dev->name, offset, spi_flash->page_size); return -EINVAL; + } status = spi_claim_bus(spi); if (status) { |
