Skip to contentSkip to conversation

mmc_spi: add a status check for spi_sync_locked

PATCH In review Kangjie Lu 3 participants 3 messages Mar 11, 2019 – Mar 18, 2019

Subsystems (2)
lore
Share & tools
lore

Kangjie Lu

author
#0 lore raw

PATCH v2 1/1 mmc_spi: add a status check for spi_sync_locked

In case spi_sync_locked fails, the fix reports the error and returns the error code upstream.

---
 drivers/mmc/host/mmc_spi.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/host/mmc_spi.c +4 -0
index 1b1498805972..a3533935e282 100644
@@ -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,
Signature · 1 line
2.17.1
Reviewed-by on v2 1/1
#1 lore raw

Hi Kangjie,

Thank you for the patch.

Quoted 4 lines · Kangjie Lu

In case spi_sync_locked fails, the fix reports the error and returns the error code upstream.

Quoted 19 lines
---
 drivers/mmc/host/mmc_spi.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/host/mmc_spi.c +4 -0
index 1b1498805972..a3533935e282 100644
@@ -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,
Signature · 3 lines
Regards,

Laurent Pinchart
#2 lore raw
In reply to Kangjie Lu
Quoted 5 lines · Kangjie Lu

In case spi_sync_locked fails, the fix reports the error and returns the error code upstream.

Applied for next, thanks!

Kind regards
Uffe

Quoted 22 lines
---
 drivers/mmc/host/mmc_spi.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/host/mmc_spi.c +4 -1
index 1b1498805972..a3533935e282 100644
@@ -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