[U-Boot] [U-Boot, U-BOOT] sf: Fix sf read for memory-mapped SPI flashes

Jagan Teki jagannadh.teki at gmail.com
Sun Jun 2 20:44:37 CEST 2013


On 27-05-2013 15:44, Jagannadha Sutradharudu Teki 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>
> Acked-by: Simon Glass <sjg at chromium.org>
>
> ---
> 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);
Applied to u-boot-spi/master

--
Thanks,
Jagan.


More information about the U-Boot mailing list