Re: [PATCH v2 6/6] gpiolib: let the character device free its IRQs first on chip removal

From: Andy Shevchenko

Date: Mon Oct 19 2026 - 04:42:55 EST


On Fri, Oct 16, 2026 at 09:40:03PM +0800, Kent Gibson wrote:
> On Fri, Oct 16, 2026 at 12:23:38PM +0300, Adrian Ambrozewicz wrote:

...

> > + /* Called with gdev->chip already NULL, so gpiod_to_irq() can't be used. */
> > + if (gc->to_irq)
> > + irq = gc->to_irq(gc, gpiod_hwgpio(desc));
> > + else
> > + irq = 0;
> > + if (irq <= 0)
> > + return;
>
> Perhaps I'm channelling Andy here, but how about:

It was in the previous version and I suggested to move it to the above. Seems
like we have an opposite comments. Can you provide a rationale behind your choice?

> if (!gc->to_irq)
> return;
> irq = gc->to_irq(gc, gpiod_hwgpio(desc));
> if (irq <= 0)
> return;

--
With Best Regards,
Andy Shevchenko