sf: Fix sf read for memory-mapped SPI flashes
authorJagannadha Sutradharudu Teki <jagannadha.sutradharudu-teki@xilinx.com>
Mon, 27 May 2013 10:14:14 +0000 (10:14 +0000)
committerJagannadha Sutradharudu Teki <jaganna@xilinx.com>
Sun, 2 Jun 2013 18:34:40 +0000 (00:04 +0530)
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 <jaganna@xilinx.com>
Acked-by: Simon Glass <sjg@chromium.org>
drivers/mtd/spi/spi_flash.c

index 111185af17586900b7ff447ead1e0ea9d131ecc4..6fa932cbd9c3de70300a136e13136932e7ad49c1 100644 (file)
@@ -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);