[U-Boot] [PATCH v3 3/4] sf: Add debug messages on spi_flash_read_common

Jagan Teki jagannadh.teki at gmail.com
Sun Jun 23 20:05:41 CEST 2013


On 21-06-2013 19:19, Jagannadha Sutradharudu Teki wrote:
> - Added debug's on spi_flash_read_common()
> - Added space
>
> Signed-off-by: Jagannadha Sutradharudu Teki <jaganna at xilinx.com>
> ---
> Changes for v3:
> 	-
> Changes for v2:
> 	-
>
>   drivers/mtd/spi/spi_flash.c | 12 +++++++++++-
>   1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
> index a329850..51142d8 100644
> --- a/drivers/mtd/spi/spi_flash.c
> +++ b/drivers/mtd/spi/spi_flash.c
> @@ -254,8 +254,18 @@ int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd,
>   	struct spi_slave *spi = flash->spi;
>   	int ret;
>
> -	spi_claim_bus(spi);
> +	ret = spi_claim_bus(flash->spi);
> +	if (ret) {
> +		debug("SF: unable to claim SPI bus\n");
> +		return ret;
> +	}
> +
>   	ret = spi_flash_cmd_read(spi, cmd, cmd_len, data, data_len);
> +	if (ret < 0) {
> +		debug("SF: read cmd failed\n");
> +		return ret;
> +	}
> +
>   	spi_release_bus(spi);
>
>   	return ret;
>
Applied to u-boot-spi/master

--
Thanks,
Jagan.


More information about the U-Boot mailing list