From: Jagannadha Sutradharudu Teki Date: Mon, 27 May 2013 10:14:14 +0000 (+0000) Subject: sf: Fix sf read for memory-mapped SPI flashes X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=0d3b596aa35fd828f2147c6d3c86d4e2730f7b29;p=project%2Fbcm63xx%2Fu-boot.git 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 --- 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);