Skip to content

Commit f4a31fa

Browse files
andy-shevlinusw
authored andcommitted
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: a1d1e0e ("pinctrl: nuvoton: Add driver for WPCM450") Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Jonathan Neuschäfer <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 66db794 commit f4a31fa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/pinctrl/nuvoton/pinctrl-wpcm450.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,10 +1081,13 @@ static int wpcm450_gpio_register(struct platform_device *pdev,
10811081

10821082
girq->num_parents = 0;
10831083
for (i = 0; i < WPCM450_NUM_GPIO_IRQS; i++) {
1084-
int irq = fwnode_irq_get(child, i);
1084+
int irq;
10851085

1086+
irq = fwnode_irq_get(child, i);
10861087
if (irq < 0)
10871088
break;
1089+
if (!irq)
1090+
continue;
10881091

10891092
girq->parents[i] = irq;
10901093
girq->num_parents++;

0 commit comments

Comments
 (0)