diff mbox series

[v2] mmc_spi: add a status check for spi_sync_locked

Message ID 20190311055334.13670-1-kjlu@umn.edu (mailing list archive)
State New, archived
Headers show
Series [v2] mmc_spi: add a status check for spi_sync_locked | expand

Commit Message

Kangjie Lu March 11, 2019, 5:53 a.m. UTC
In case spi_sync_locked fails, the fix reports the error and
returns the error code upstream.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
 drivers/mmc/host/mmc_spi.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Laurent Pinchart March 11, 2019, 8:25 a.m. UTC | #1
Hi Kangjie,

Thank you for the patch.

On Mon, Mar 11, 2019 at 12:53:33AM -0500, Kangjie Lu wrote:
> In case spi_sync_locked fails, the fix reports the error and
> returns the error code upstream.
> 
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/mmc/host/mmc_spi.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
> index 1b1498805972..a3533935e282 100644
> --- a/drivers/mmc/host/mmc_spi.c
> +++ b/drivers/mmc/host/mmc_spi.c
> @@ -819,6 +819,10 @@ mmc_spi_readblock(struct mmc_spi_host *host, struct spi_transfer *t,
>  	}
>  
>  	status = spi_sync_locked(spi, &host->m);
> +	if (status < 0) {
> +		dev_dbg(&spi->dev, "read error %d\n", status);
> +		return status;
> +	}
>  
>  	if (host->dma_dev) {
>  		dma_sync_single_for_cpu(host->dma_dev,
Ulf Hansson March 18, 2019, 10:51 a.m. UTC | #2
On Mon, 11 Mar 2019 at 06:53, Kangjie Lu <kjlu@umn.edu> wrote:
>
> In case spi_sync_locked fails, the fix reports the error and
> returns the error code upstream.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/mmc_spi.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
> index 1b1498805972..a3533935e282 100644
> --- a/drivers/mmc/host/mmc_spi.c
> +++ b/drivers/mmc/host/mmc_spi.c
> @@ -819,6 +819,10 @@ mmc_spi_readblock(struct mmc_spi_host *host, struct spi_transfer *t,
>         }
>
>         status = spi_sync_locked(spi, &host->m);
> +       if (status < 0) {
> +               dev_dbg(&spi->dev, "read error %d\n", status);
> +               return status;
> +       }
>
>         if (host->dma_dev) {
>                 dma_sync_single_for_cpu(host->dma_dev,
> --
> 2.17.1
>
diff mbox series

Patch

diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
index 1b1498805972..a3533935e282 100644
--- a/drivers/mmc/host/mmc_spi.c
+++ b/drivers/mmc/host/mmc_spi.c
@@ -819,6 +819,10 @@  mmc_spi_readblock(struct mmc_spi_host *host, struct spi_transfer *t,
 	}
 
 	status = spi_sync_locked(spi, &host->m);
+	if (status < 0) {
+		dev_dbg(&spi->dev, "read error %d\n", status);
+		return status;
+	}
 
 	if (host->dma_dev) {
 		dma_sync_single_for_cpu(host->dma_dev,