From: Christophe JAILLET Date: Tue, 16 Oct 2018 07:13:46 +0000 (+0200) Subject: mtd: spi-nor: cadence-quadspi: Return error code in cqspi_direct_read_execute() X-Git-Tag: rel_imx_4.19.35_1.1.0~8603 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=9e9dd0f1c345ba9b4d3d409345aa362815785bf5;p=linux.git mtd: spi-nor: cadence-quadspi: Return error code in cqspi_direct_read_execute() commit 91d7b67000c6e9bd605624079fee5a084238ad92 upstream. We return 0 unconditionally in 'cqspi_direct_read_execute()'. However, 'ret' is set to some error codes in several error handling paths. Return 'ret' instead to propagate the error code. Fixes: ffa639e069fb ("mtd: spi-nor: cadence-quadspi: Add DMA support for direct mode reads") Cc: Signed-off-by: Christophe JAILLET Signed-off-by: Boris Brezillon Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/mtd/spi-nor/cadence-quadspi.c b/drivers/mtd/spi-nor/cadence-quadspi.c index 8e714fbfa521..6e9cbd1a0b6d 100644 --- a/drivers/mtd/spi-nor/cadence-quadspi.c +++ b/drivers/mtd/spi-nor/cadence-quadspi.c @@ -996,7 +996,7 @@ static int cqspi_direct_read_execute(struct spi_nor *nor, u_char *buf, err_unmap: dma_unmap_single(nor->dev, dma_dst, len, DMA_DEV_TO_MEM); - return 0; + return ret; } static ssize_t cqspi_read(struct spi_nor *nor, loff_t from,