mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-18 06:58:54 +00:00
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 <wenyou.yang@microchip.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jagan@openedev.com>
This commit is contained in:
parent
ac6777b1e3
commit
8fc2faefdd
1 changed files with 8 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue