Re: [PATCH v2] net: mvmdio: avoid error message for optional IRQ

From: Chris Packham
Date: Mon Mar 16 2020 - 05:32:32 EST


On Mon, 2020-03-16 at 09:38 +0100, Andrew Lunn wrote:
> > Actually on closer inspection I think this is wrong.
> > platform_get_irq_optional() will return -ENXIO if the irq is not
> > specified.
>
> The _optional is then pointless. And different to all the other
> _optional functions which don't return an error if the property is
> not
> defined.
>
> Are you really sure about this? I don't have the time right now to
> check.
>

Regretabbly yes[1]. It caught me by surprise too. I only noticed when I
went to use a different board that used that driver. I think the
problem is that on some platforms 0 is a valid irq so it can't just be
used to indicate a missing interrupt.

[1] - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/base/platform.c#n138