* [PATCH] pinctrl: cy8c95x0: Use proper error code
@ 2026-02-28 2:05 Ethan Tidmore
2026-02-28 10:13 ` Andy Shevchenko
0 siblings, 1 reply; 3+ messages in thread
From: Ethan Tidmore @ 2026-02-28 2:05 UTC (permalink / raw)
To: Andy Shevchenko, Patrick Rudolph, Linus Walleij
Cc: linux-gpio, linux-kernel, Ethan Tidmore
The function cy8c95x0_irq_pending() returns type bool not an error code.
Use error code -EIO if cy8c95x0_irq_pending() fails.
Detected by Smatch:
drivers/pinctrl/pinctrl-cy8c95x0.c:1303 cy8c95x0_irq_setup() warn:
passing positive error code '1' to 'dev_err_probe'
Fixes: 014884732095b ("pinctrl: cy8c95x0: Unify messages with help of dev_err_probe()")
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
---
drivers/pinctrl/pinctrl-cy8c95x0.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-cy8c95x0.c b/drivers/pinctrl/pinctrl-cy8c95x0.c
index 0d295ebc33d1..5796ce516788 100644
--- a/drivers/pinctrl/pinctrl-cy8c95x0.c
+++ b/drivers/pinctrl/pinctrl-cy8c95x0.c
@@ -1300,7 +1300,7 @@ static int cy8c95x0_irq_setup(struct cy8c95x0_pinctrl *chip, int irq)
/* Read IRQ status register to clear all pending interrupts */
ret = cy8c95x0_irq_pending(chip, pending_irqs);
if (ret)
- return dev_err_probe(dev, ret, "failed to clear irq status register\n");
+ return dev_err_probe(dev, -EIO, "failed to clear irq status register\n");
/* Mask all interrupts */
bitmap_fill(chip->irq_mask, MAX_LINE);
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] pinctrl: cy8c95x0: Use proper error code
2026-02-28 2:05 [PATCH] pinctrl: cy8c95x0: Use proper error code Ethan Tidmore
@ 2026-02-28 10:13 ` Andy Shevchenko
2026-02-28 14:48 ` Ethan Tidmore
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2026-02-28 10:13 UTC (permalink / raw)
To: Ethan Tidmore; +Cc: Patrick Rudolph, Linus Walleij, linux-gpio, linux-kernel
On Fri, Feb 27, 2026 at 08:05:38PM -0600, Ethan Tidmore wrote:
> The function cy8c95x0_irq_pending() returns type bool not an error code.
>
> Use error code -EIO if cy8c95x0_irq_pending() fails.
>
> Detected by Smatch:
> drivers/pinctrl/pinctrl-cy8c95x0.c:1303 cy8c95x0_irq_setup() warn:
> passing positive error code '1' to 'dev_err_probe'
I sent already a patch and the code is -EBUSY, because if we ever get non-zero
here, it means that IO was fine, the interrupt status was not cleared.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] pinctrl: cy8c95x0: Use proper error code
2026-02-28 10:13 ` Andy Shevchenko
@ 2026-02-28 14:48 ` Ethan Tidmore
0 siblings, 0 replies; 3+ messages in thread
From: Ethan Tidmore @ 2026-02-28 14:48 UTC (permalink / raw)
To: Andy Shevchenko, Ethan Tidmore
Cc: Patrick Rudolph, Linus Walleij, linux-gpio, linux-kernel
On Sat Feb 28, 2026 at 4:13 AM CST, Andy Shevchenko wrote:
> On Fri, Feb 27, 2026 at 08:05:38PM -0600, Ethan Tidmore wrote:
>> The function cy8c95x0_irq_pending() returns type bool not an error code.
>>
>> Use error code -EIO if cy8c95x0_irq_pending() fails.
>>
>> Detected by Smatch:
>> drivers/pinctrl/pinctrl-cy8c95x0.c:1303 cy8c95x0_irq_setup() warn:
>> passing positive error code '1' to 'dev_err_probe'
>
> I sent already a patch and the code is -EBUSY, because if we ever get non-zero
> here, it means that IO was fine, the interrupt status was not cleared.
I should have checked lore before sending that one off. Thanks for the
error code pointer too.
Thanks,
ET
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-28 14:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-28 2:05 [PATCH] pinctrl: cy8c95x0: Use proper error code Ethan Tidmore
2026-02-28 10:13 ` Andy Shevchenko
2026-02-28 14:48 ` Ethan Tidmore
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox