[PATCH 5/5] pinctrl: bcm: iproc-gpio: Propagate errors from optional IRQ lookup
Andy Shevchenko
andy.shevchenko at gmail.com
Sun Aug 9 23:48:43 PDT 2026
On Mon, Aug 10, 2026 at 8:32 AM <phucduc.bui at gmail.com> wrote:
>
> From: bui duc phuc <phucduc.bui at gmail.com>
>
> platform_get_irq_optional() returns a positive IRQ number on success or
> a negative error code on failure. For an optional IRQ, -ENXIO indicates
> that no optional IRQ is available, while other errors should be propagated.
>
> Propagate all error codes returned by platform_get_irq_optional() other
> than -ENXIO.
...
> /* optional GPIO interrupt support */
> irq = platform_get_irq_optional(pdev, 0);
> + if (irq < 0 && irq != -ENXIO)
> + return irq;
Here and everywhere else in the similar contributions you made all
over the kernel:
> if (irq > 0) {
> struct gpio_irq_chip *girq;
Use the 'else' branch instead of the above.
} else if (irq != -ENXIO) {
return irq;
But before doing that, check carefully if this is really what we want
to have and how it will affect the driver behaviour in such a case.
--
With Best Regards,
Andy Shevchenko
More information about the linux-arm-kernel
mailing list