mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 06:31:49 +00:00
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: a1d1e0e3d8
("pinctrl: nuvoton: Add driver for WPCM450")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Link: https://lore.kernel.org/r/20220927175509.15695-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
66db794ad5
commit
f4a31facfa
@ -1081,10 +1081,13 @@ static int wpcm450_gpio_register(struct platform_device *pdev,
|
|||||||
|
|
||||||
girq->num_parents = 0;
|
girq->num_parents = 0;
|
||||||
for (i = 0; i < WPCM450_NUM_GPIO_IRQS; i++) {
|
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)
|
if (irq < 0)
|
||||||
break;
|
break;
|
||||||
|
if (!irq)
|
||||||
|
continue;
|
||||||
|
|
||||||
girq->parents[i] = irq;
|
girq->parents[i] = irq;
|
||||||
girq->num_parents++;
|
girq->num_parents++;
|
||||||
|
Loading…
Reference in New Issue
Block a user