summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-s3c64xx.c
diff options
context:
space:
mode:
authorSylwester Nawrocki2018-04-16 17:40:19 +0200
committerMark Brown2018-04-17 12:46:52 +0200
commit4e0b82ee3157218747f87d6fe13a3ee8c29bc509 (patch)
tree8398057d778b041ecd7f3a196d62197c57cfbdac /drivers/spi/spi-s3c64xx.c
parentspi: spi-s3c64xx: Remove unused s3c64xx_spi_hwinit() function argument (diff)
downloadkernel-qcow2-linux-4e0b82ee3157218747f87d6fe13a3ee8c29bc509.tar.gz
kernel-qcow2-linux-4e0b82ee3157218747f87d6fe13a3ee8c29bc509.tar.xz
kernel-qcow2-linux-4e0b82ee3157218747f87d6fe13a3ee8c29bc509.zip
spi: spi-s3c64xx: Do not ignore timeout errors in polling I/O mode
Currently timeout errors in polling I/O mode transfer are silently ignored. Fix it by returning an error when we time out waiting on the RX FIFO level to reach the transfer length. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Reviewed-by: Andi Shyti <andi@etezian.org> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-s3c64xx.c')
-rw-r--r--drivers/spi/spi-s3c64xx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index b7333a883442..4c27426bcb40 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -503,6 +503,8 @@ static int wait_for_pio(struct s3c64xx_spi_driver_data *sdd,
status = readl(regs + S3C64XX_SPI_STATUS);
} while (RX_FIFO_LVL(status, sdd) < xfer->len && --val);
+ if (!val)
+ return -EIO;
/* If it was only Tx */
if (!xfer->rx_buf) {