Re: [PATCH v15 03/14] gpio: regmap: remove gpiochip before tearing down irqchip

From: Andy Shevchenko

Date: Thu Nov 19 2026 - 02:40:29 EST


On Wed, Nov 18, 2026 at 03:42:20PM +0800, Long Zhao via B4 Relay wrote:
>
> gpiochip_remove() calls acpi_gpiochip_free_interrupts() and
> gpiod_free_irqs(). Both still need the irq domain.
> regmap_del_irq_chip() removes that domain, so remove the
> gpiochip first.

So, AFAIR Michael rose the question that this patch makes the unregister flow
not reverse symmetrical to the register one. I took a look at this and I can
say that this is a bit twisted. The pure creation part is independent, but
to function it requires GPIO chip to be instantiated. So, yeah, this patch
is a bit controversial. Let me see what we can do here.

--
With Best Regards,
Andy Shevchenko