Commit f4a31fac authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Walleij

pinctrl: wpcm450: Correct the fwnode_irq_get() return value check

fwnode_irq_get() can return zero to indicate IRQ mapping errors.
Handle this case by skipping the interrupt resource.

Fixes: a1d1e0e3 ("pinctrl: nuvoton: Add driver for WPCM450")
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarJonathan Neuschäfer <j.neuschaefer@gmx.net>
Link: https://lore.kernel.org/r/20220927175509.15695-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 66db794a
......@@ -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++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment