summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-rockchip-sfc.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2021-08-18 15:10:51 +0100
committerMark Brown <broonie@kernel.org>2021-08-23 16:41:08 +0100
commit745649c59a0d1fde9dcc02286f23f8c78a1f724d (patch)
tree174a8c1de21d57e24c5d3d2faf345b0cc624734d /drivers/spi/spi-rockchip-sfc.c
parent8d00f9819458b95301e274c6df705df2963ba34f (diff)
spi: rockchip-sfc: Fix assigned but never used return error codes
Currently there are two places where the error return variable ret is being assigned -ETIMEDOUT on timeout errors and this value is not being returned. Fix this by returning -ETIMEDOUT rather than redundantly assiging it to ret. Addresses-Coverity: ("Unused value") Fixes: 0b89fc0a367e ("spi: rockchip-sfc: add rockchip serial flash controller") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210818141051.36320-1-colin.king@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-rockchip-sfc.c')
-rw-r--r--drivers/spi/spi-rockchip-sfc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c
index 81154a8836fc..a46b38544027 100644
--- a/drivers/spi/spi-rockchip-sfc.c
+++ b/drivers/spi/spi-rockchip-sfc.c
@@ -257,7 +257,7 @@ static int rockchip_sfc_wait_txfifo_ready(struct rockchip_sfc *sfc, u32 timeout_
if (ret) {
dev_dbg(sfc->dev, "sfc wait tx fifo timeout\n");
- ret = -ETIMEDOUT;
+ return -ETIMEDOUT;
}
return (status & SFC_FSR_TXLV_MASK) >> SFC_FSR_TXLV_SHIFT;
@@ -274,7 +274,7 @@ static int rockchip_sfc_wait_rxfifo_ready(struct rockchip_sfc *sfc, u32 timeout_
if (ret) {
dev_dbg(sfc->dev, "sfc wait rx fifo timeout\n");
- ret = -ETIMEDOUT;
+ return -ETIMEDOUT;
}
return (status & SFC_FSR_RXLV_MASK) >> SFC_FSR_RXLV_SHIFT;