]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
mmc_spi: add a status check for spi_sync_locked
authorKangjie Lu <kjlu@umn.edu>
Mon, 11 Mar 2019 05:53:33 +0000 (00:53 -0500)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
BugLink: https://bugs.launchpad.net/bugs/1838700
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/mmc/host/mmc_spi.c

index 67f6bd24a9d0c11fdb462587197c41fac8422de5..ea254d00541f12c0cc9b0b8bbf0db885febd3cb1 100644 (file)
@@ -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,