Re: [PATCH 1/4] watchdog: qcom: Propagate errors from optional IRQ lookup
Guenter Roeck <[email protected]> Fri, 7 Aug 2026 17:23:17 -0700
| Newsgroups | org.infradead.lists.linux-mediatek,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-kernel,org.kernel.vger.linux-watchdog,org.ozlabs.lists.linux-aspeed |
|---|---|
| Message-ID | <[email protected]> |
On 8/7/26 01:16, [email protected] wrote: > From: bui duc phuc <[email protected]> > > platform_get_irq_optional() returns a positive IRQ number on success or > a negative error code on failure. For an optional IRQ, -ENXIO indicates > that no IRQ is available, while other errors should be propagated. > > Instead of only checking for -EPROBE_DEFER, propagate all error codes > returned by platform_get_irq_optional() other than -ENXIO, so that > failures are properly reported to the caller. > > Signed-off-by: bui duc phuc <[email protected]> > --- > drivers/watchdog/qcom-wdt.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/watchdog/qcom-wdt.c b/drivers/watchdog/qcom-wdt.c > index 49bd04841f0c..a8eb1d8f24f0 100644 > --- a/drivers/watchdog/qcom-wdt.c > +++ b/drivers/watchdog/qcom-wdt.c > @@ -298,8 +298,8 @@ static int qcom_wdt_probe(struct platform_device *pdev) > wdt->wdd.info = &qcom_wdt_pt_info; > wdt->wdd.pretimeout = 1; > } else { > - if (irq == -EPROBE_DEFER) > - return -EPROBE_DEFER; > + if (irq != -ENXIO) > + return irq; This is wrong. Check the if() path - the code ends up here if pretimeout == 0, even if irq > 0. Guenter