
This patch adds a print messages while using 'sf erase' command to make sure that how many bytes erased in flash device.
Signed-off-by: Jagannadha Sutradharudu Teki jagannadh.teki@gmail.com --- Changes in v2: Move print messages from spi_flash.c into cmd_sf.c common/cmd_sf.c | 11 ++++++----- drivers/mtd/spi/spi_flash.c | 2 -- 2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/common/cmd_sf.c b/common/cmd_sf.c index 5ac1d0c..ddb1a65 100644 --- a/common/cmd_sf.c +++ b/common/cmd_sf.c @@ -266,13 +266,14 @@ static int do_spi_flash_erase(int argc, char * const argv[]) return 1; }
+ printf("SF: Erasing flash... "); + ret = spi_flash_erase(flash, offset, len); - if (ret) { - printf("SPI flash %s failed\n", argv[0]); - return 1; - }
- return 0; + printf("%zu bytes @ %#x erased: %s\n", (size_t)len, (u32)offset, + ret ? "ERROR" : "OK"); + + return ret == 0 ? 0 : 1; }
static int do_spi_flash(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index 00aece9..43e0334 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -235,8 +235,6 @@ int spi_flash_cmd_erase(struct spi_flash *flash, u32 offset, size_t len) goto out; }
- debug("SF: Successfully erased %zu bytes @ %#x\n", len, start); - out: spi_release_bus(flash->spi); return ret;