summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKangjie Lu <kjlu@umn.edu>2019-03-11 08:53:33 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-31 16:46:22 +0300
commitfa291e89997a27b0b34b9302ec8a8bf925dcecf2 (patch)
treea72060d2fc6c041c53aea7c07d9ee97bdb108dce
parent059c2f5326a07b0f2d284c2a8ff1fbe93010caae (diff)
downloadlinux-fa291e89997a27b0b34b9302ec8a8bf925dcecf2.tar.xz
mmc_spi: add a status check for spi_sync_locked
[ Upstream commit 611025983b7976df0183390a63a2166411d177f1 ] 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> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/mmc/host/mmc_spi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
index 67f6bd24a9d0..ea254d00541f 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,