Re: [PATCH v2] mfd: intel-lpss: Fix IRQ check

From: Andy Shevchenko
Date: Thu Nov 02 2023 - 08:38:50 EST


On Wed, Nov 01, 2023 at 12:47:17PM +0200, Mika Westerberg wrote:
> On Wed, Nov 01, 2023 at 11:38:28AM +0200, Andy Shevchenko wrote:
> > On Wed, Nov 01, 2023 at 09:03:10AM +0200, Mika Westerberg wrote:
> > > On Wed, Nov 01, 2023 at 06:26:43AM +0000, Chen Ni wrote:

...

> > > > - if (!info || !info->mem || info->irq <= 0)
> > > > + if (!info || !info->mem)
> > >
> > > This check (info->irq <= 0) covers both "invalid" interrupt numbers
> > > (that's the negative errno and 0 as no interrupt) so I don't see how
> > > this change makes it any better and the changelog does not clarify it
> > > either.
> >
> > It makes sense. The IRQ here may not be 0. We should actually fix
> > the PCI code to guarantee that (platform_get_irq() guarantees that
> > in platform driver).
>
> Yeah but I mean the check above handles any "invalid" interrupt number
> just fine regardless. I don't see any point changing that.

The point is to have proper error code to be returned. Currently it's shadowed
in this check.

--
With Best Regards,
Andy Shevchenko