[PATCH 3/3] spi: rockchip: Drop dead zero-check on fifo_len
John Madieu
john.madieu at gmail.com
Sat Apr 25 02:29:36 PDT 2026
rs->fifo_len is assigned from get_fifo_len(), which returns 64 for the
two known SPI controller versions and 32 for everything else - never 0.
The subsequent
if (!rs->fifo_len)
return dev_err_probe(...);
is therefore unreachable.
Drop the check. If unknown controller versions ever need to fail probe
explicitly, that should be expressed in get_fifo_len() itself, not
through an impossible post-condition.
Signed-off-by: John Madieu <john.madieu at gmail.com>
---
drivers/spi/spi-rockchip.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index 231fbcf0e7aa..1bd48376498a 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -824,8 +824,6 @@ static int rockchip_spi_probe(struct platform_device *pdev)
}
rs->fifo_len = get_fifo_len(rs);
- if (!rs->fifo_len)
- return dev_err_probe(&pdev->dev, -EINVAL, "Failed to get fifo length\n");
pm_runtime_set_autosuspend_delay(&pdev->dev, ROCKCHIP_AUTOSUSPEND_TIMEOUT);
pm_runtime_use_autosuspend(&pdev->dev);
--
2.25.1
More information about the Linux-rockchip
mailing list