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

Bui Duc Phuc <[email protected]>
Newsgroups gmane.linux.kernel.gpio,gmane.linux.ports.arm.kernel,gmane.linux.kernel
Message-ID <CAABR9nETzzsjzE0JnnLC5tX7d=0yZW9bt+t8DuVxV=JSb1VsYw@mail.gmail.com>
Hi Andy,
Thank you for your review .

>
> 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 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.

Best regards,
Phuc
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.