pinctrl: wpcm450: Correct the fwnode_irq_get() return value check
Subsystems (3)
PATCH v2 1/1 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 a1d1e0e3d80a ("pinctrl: nuvoton: Add driver for WPCM450")
Signed-off-by Andy Shevchenko <[email protected]>
---
v2: amended commit message (Jonathan)
drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/pinctrl/nuvoton/pinctrl-wpcm450.c +4 -1
@@ -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++;
Signature · 1 line
2.35.1
Quoted 19 lines · Andy Shevchenko
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 <[email protected]>---
v2: amended commit message (Jonathan)drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/pinctrl/nuvoton/pinctrl-wpcm450.c +0
-1@@ -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);
drivers/pinctrl/nuvoton/pinctrl-wpcm450.c static int wpcm450_gpio_register(struct platform_device *pdev, · line 1093
Quoted 10 lines
drivers/pinctrl/nuvoton/pinctrl-wpcm450.c +4
-0+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 <[email protected]>
Thanks!
Quoted 5 lines · Andy Shevchenko
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 <[email protected]>
Patch applied!
Yours,
Linus Walleij