Message ID | 20220927175509.15695-1-andriy.shevchenko@linux.intel.com |
---|---|
State | Accepted |
Commit | f4a31facfa80df2f440a2fdc2b7f58d6c23925b0 |
Headers | show |
Series | [v2,1/1] pinctrl: wpcm450: Correct the fwnode_irq_get() return value check | expand |
On Tue, Sep 27, 2022 at 08:55:09PM +0300, Andy Shevchenko wrote: > fwnode_irq_get() can return zero to indicate IRQ mapping errors. > Handle this case by skipping the interrupt resource. > > Fixes: a1d1e0e3d80a ("pinctrl: nuvoton: Add driver for WPCM450") > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > --- > v2: amended commit message (Jonathan) > drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c > index 0dbeb91f0bf2..8193b92da403 100644 > --- a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c > +++ b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c > @@ -1081,10 +1081,13 @@ static int wpcm450_gpio_register(struct platform_device *pdev, > > girq->num_parents = 0; > for (i = 0; i < WPCM450_NUM_GPIO_IRQS; i++) { > - int irq = fwnode_irq_get(child, i); > + int irq; > > + irq = fwnode_irq_get(child, i); > if (irq < 0) > break; > + if (!irq) > + continue; > > girq->parents[i] = irq; > girq->num_parents++; Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Thanks!
On Tue, Sep 27, 2022 at 7:54 PM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > fwnode_irq_get() can return zero to indicate IRQ mapping errors. > Handle this case by skipping the interrupt resource. > > Fixes: a1d1e0e3d80a ("pinctrl: nuvoton: Add driver for WPCM450") > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Patch applied! Yours, Linus Walleij
diff --git a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c index 0dbeb91f0bf2..8193b92da403 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c +++ b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c @@ -1081,10 +1081,13 @@ static int wpcm450_gpio_register(struct platform_device *pdev, girq->num_parents = 0; for (i = 0; i < WPCM450_NUM_GPIO_IRQS; i++) { - int irq = fwnode_irq_get(child, i); + int irq; + irq = fwnode_irq_get(child, i); if (irq < 0) break; + if (!irq) + continue; girq->parents[i] = irq; girq->num_parents++;
fwnode_irq_get() can return zero to indicate IRQ mapping errors. Handle this case by skipping the interrupt resource. Fixes: a1d1e0e3d80a ("pinctrl: nuvoton: Add driver for WPCM450") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- v2: amended commit message (Jonathan) drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)