From 0d3b596aa35fd828f2147c6d3c86d4e2730f7b29 Mon Sep 17 00:00:00 2001 From: Jagannadha Sutradharudu Teki Date: Mon, 27 May 2013 10:14:14 +0000 Subject: [PATCH] sf: Fix sf read for memory-mapped SPI flashes Missing return after memcpy is done for memory-mapped SPI flashes, hence added retun 0 after memcpy done. The return is missing in below patch "sf: Enable FDT-based configuration and memory mapping" (sha1: bb8215f437a7c948eec82a6abe754c226978bd6d) Signed-off-by: Jagannadha Sutradharudu Teki Acked-by: Simon Glass --- drivers/mtd/spi/spi_flash.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index 111185af17..6fa932cbd9 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -150,8 +150,10 @@ int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 offset, u8 cmd[5]; /* Handle memory-mapped SPI */ - if (flash->memory_map) + if (flash->memory_map) { memcpy(data, flash->memory_map + offset, len); + return 0; + } cmd[0] = CMD_READ_ARRAY_FAST; spi_flash_addr(offset, cmd); -- 2.25.1