[U-Boot] [PATCH 2/4] sf: Add print message on flash read function

Jagannadha Sutradharudu Teki jagannadh.teki at gmail.com
Mon Dec 10 15:41:59 CET 2012


This patch adds a print message on spi_flash_cmd_read_fast()
to make sure that how many bytes read from flash device.

Signed-off-by: Jagannadha Sutradharudu Teki <jagannadh.teki at gmail.com>
---
 drivers/mtd/spi/spi_flash.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 464c2ab..800ed8b 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -139,12 +139,17 @@ int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 offset,
 		size_t len, void *data)
 {
 	u8 cmd[5];
+	int ret;
 
 	cmd[0] = CMD_READ_ARRAY_FAST;
 	spi_flash_addr(offset, cmd);
 	cmd[4] = 0x00;
 
-	return spi_flash_read_common(flash, cmd, sizeof(cmd), data, len);
+	ret = spi_flash_read_common(flash, cmd, sizeof(cmd), data, len);
+	printf("SF: re-program %s %zu bytes @ %#x\n",
+		ret ? "failure" : "success", len, offset);
+
+	return ret;
 }
 
 int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout,
-- 
1.7.0.4



More information about the U-Boot mailing list