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: 0b89fc0a36 ("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>
This commit is contained in:
Colin Ian King 2021-08-18 15:10:51 +01:00 committed by Mark Brown
parent 8d00f98194
commit 745649c59a
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 2 additions and 2 deletions

View File

@ -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;