From: John Madieu <john.madieu@gmail.com>
To: broonie@kernel.org, heiko@sntech.de
Cc: jon.lin@rock-chips.com, linux-spi@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
John Madieu <john.madieu@gmail.com>
Subject: [PATCH 3/3] spi: rockchip: Drop dead zero-check on fifo_len
Date: Sat, 25 Apr 2026 09:29:36 +0000 [thread overview]
Message-ID: <20260425092936.2590132-4-john.madieu@gmail.com> (raw)
In-Reply-To: <20260425092936.2590132-1-john.madieu@gmail.com>
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@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
next prev parent reply other threads:[~2026-04-25 9:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-25 9:29 [PATCH 0/3] spi: rockchip: ISR fix and minor cleanups John Madieu
2026-04-25 9:29 ` [PATCH 1/3] spi: rockchip: Read ISR, not IMR, to detect cs-inactive IRQ John Madieu
2026-04-25 9:29 ` [PATCH 2/3] spi: rockchip: Drop unused and broken CR0 macros John Madieu
2026-04-25 9:29 ` John Madieu [this message]
2026-04-26 20:36 ` [PATCH 3/3] spi: rockchip: Drop dead zero-check on fifo_len Mark Brown
[not found] ` <CAM9Qs9B8SSGXrR47toj9P+_EUHzrwKwHnu9askVhGxm9WFzQCQ@mail.gmail.com>
2026-04-26 21:03 ` Mark Brown
2026-04-26 21:57 ` (subset) [PATCH 0/3] spi: rockchip: ISR fix and minor cleanups Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260425092936.2590132-4-john.madieu@gmail.com \
--to=john.madieu@gmail.com \
--cc=broonie@kernel.org \
--cc=heiko@sntech.de \
--cc=jon.lin@rock-chips.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox