Re: [PATCH 2/5] pinctrl: keembay: Propagate errors from optional IRQ lookup

Andy Shevchenko <[email protected]>
Newsgroups org.kernel.vger.linux-gpio,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel
Organization Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo
Message-ID <[email protected]>
On Tue, Aug 11, 2026 at 09:48:01AM +0700, Bui Duc Phuc wrote:

> > While this looks okay, have you considered actually having the
> > platform_get_irq_optional() to be optional in this sense?
> 
> As I understand it, if we decide to use platform_get_irq_optional(),
> then -ENXIO should be handled as the expected case where the IRQ is
> not available.

If platform_get_irq_optional() was optional, it would return 0 instead of ENXIO
(and avoid printing any message in such a case).

> If we do not want to handle -ENXIO as an optional IRQ,
> then I think we should use platform_get_irq() instead,
> which matches its intended semantics:

> https://elixir.bootlin.com/linux/v7.2-rc6/source/drivers/base/platform.c#L301

> -------------------------------
> ret = platform_get_irq_optional(dev, num);
> if (ret < 0)
>         return dev_err_probe(&dev->dev, ret,
>                                             "IRQ index %u not found\n", num);
> -------------------------------
> 
> In my opinion, we should not use an optional API if the IRQ is not
> actually intended to be optional.

Right. But does it suit for this driver?

-- 
With Best Regards,
Andy Shevchenko
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.