Skip to content

Commit

Permalink
mtd: spi-nor: cadence-quadspi: Return error code in cqspi_direct_read…
Browse files Browse the repository at this point in the history
…_execute()

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: ffa639e ("mtd: spi-nor: cadence-quadspi: Add DMA support for direct mode reads")
Cc: <[email protected]>
Signed-off-by: Christophe JAILLET <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
  • Loading branch information
tititiou36 authored and Boris Brezillon committed Nov 5, 2018
1 parent d098093 commit 91d7b67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/spi-nor/cadence-quadspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_FROM_DEVICE);

return 0;
return ret;
}

static ssize_t cqspi_read(struct spi_nor *nor, loff_t from,
Expand Down

0 comments on commit 91d7b67

Please sign in to comment.