[U-Boot] [U-BOOT PATCH] sf: Fix sf read for memory-mapped SPI flashes
Jagan Teki
jagannadh.teki at gmail.com
Tue May 28 14:40:13 CEST 2013
Hi Simon,
Can you please check this change.
Thanks,
Jagan.
On Tue, May 28, 2013 at 1:44 AM, Jagannadha Sutradharudu Teki
<jagannadha.sutradharudu-teki at xilinx.com> wrote:
> 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 at xilinx.com>
> ---
> drivers/mtd/spi/spi_flash.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
> index aeb1ccb..1d45e3b 100644
> --- a/drivers/mtd/spi/spi_flash.c
> +++ b/drivers/mtd/spi/spi_flash.c
> @@ -148,8 +148,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);
> --
> 1.7.4
>
>
--
--
Thanks,
Jagan.
More information about the U-Boot
mailing list