mmc_spi: add a status check for spi_sync_locked
Subsystems (2)
PATCH 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.
Signed-off-by Kangjie Lu <[email protected]>
--- drivers/mmc/host/mmc_spi.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/mmc/host/mmc_spi.c +4 -0
@@ -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 %02x (%d)\n" , status, status); +return status; + }if (host->dma_dev) { dma_sync_single_for_cpu(host->dma_dev,
Signature · 1 line
2.17.1
Hi Kangjie,
Thank you for the patch.
Quoted 13 lines · Kangjie Lu
In case
spi_sync_lockedfails, the fix reports the error and returns the error code upstream.Signed-off-by Kangjie Lu <[email protected]>--- drivers/mmc/host/mmc_spi.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/mmc/host/mmc_spi.c +0
-0
drivers/mmc/host/mmc_spi.c mmc_spi_readblock(struct mmc_spi_host *host, struct spi_transfer *t, · line 823
Quoted 5 lines
drivers/mmc/host/mmc_spi.c +2
-0@@ -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 %02x (%d)\n" , status, status);
I don't think you need to print the status in both hex and in decimal forms. %d should be enough, error codes are usually printed in decimal in the kernel. Apart from that,
Reviewed-by Laurent Pinchart <[email protected]>
Quoted 5 lines
drivers/mmc/host/mmc_spi.c +2
-0+return status; + }if (host->dma_dev) { dma_sync_single_for_cpu(host->dma_dev,
Signature · 3 lines
Regards, Laurent Pinchart