[U-Boot] [PATCH 2/4] sf: Add print message on flash read function

Simon Glass sjg at chromium.org
Wed Dec 12 07:33:35 CET 2012


Hi,

On Mon, Dec 10, 2012 at 6:41 AM, Jagannadha Sutradharudu Teki
<jagannadh.teki at gmail.com> wrote:
> This patch adds a print message on spi_flash_cmd_read_fast()
> to make sure that how many bytes read from flash device.
>
> Signed-off-by: Jagannadha Sutradharudu Teki <jagannadh.teki at gmail.com>

I have the same verbosity comment on this patch, BTW.

Regards,
Simon

> ---
>  drivers/mtd/spi/spi_flash.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
> index 464c2ab..800ed8b 100644
> --- a/drivers/mtd/spi/spi_flash.c
> +++ b/drivers/mtd/spi/spi_flash.c
> @@ -139,12 +139,17 @@ int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 offset,
>                 size_t len, void *data)
>  {
>         u8 cmd[5];
> +       int ret;
>
>         cmd[0] = CMD_READ_ARRAY_FAST;
>         spi_flash_addr(offset, cmd);
>         cmd[4] = 0x00;
>
> -       return spi_flash_read_common(flash, cmd, sizeof(cmd), data, len);
> +       ret = spi_flash_read_common(flash, cmd, sizeof(cmd), data, len);
> +       printf("SF: re-program %s %zu bytes @ %#x\n",
> +               ret ? "failure" : "success", len, offset);
> +
> +       return ret;
>  }
>
>  int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout,
> --
> 1.7.0.4
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot


More information about the U-Boot mailing list