From patchwork Wed Dec 19 16:27:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot, U-Boot, v2, 1/6] cmd_sf: Add print messages on flash erase command From: Jagannadha Sutradharudu Teki X-Patchwork-Id: 207452 Message-Id: <1355934463-24319-1-git-send-email-jagannadh.teki@gmail.com> To: u-boot@lists.denx.de Date: Wed, 19 Dec 2012 21:57:38 +0530 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 --- 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;