Skip to content

Commit

Permalink
mmc_spi: add a status check for spi_sync_locked
Browse files Browse the repository at this point in the history
In case spi_sync_locked fails, the fix reports the error and
returns the error code upstream.

Signed-off-by: Kangjie Lu <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
  • Loading branch information
kengiter authored and storulf committed Apr 15, 2019
1 parent 1f1929f commit 6110259
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/mmc/host/mmc_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6110259

Please sign in to comment.