Re: [PATCH v1 0/3] gpio: Introduce helper to dispose IRQ mappings
From: Bartosz Golaszewski
Date: Wed Nov 04 2026 - 09:36:42 EST
On Wed, Oct 21, 2026 at 10:44:42PM +0200, Andy Shevchenko wrote:
> I have noticed that a few drivers use almost the same code to dispose IRQ
> mappings. This series to deduplicate the efforts. I only converted a couple
> of the users (there are potentially more) in order to stay in the same
> subsystem.
>
> Andy Shevchenko (3):
> gpiolib: Introduce devm_gpiochip_dispose_irq_mappings()
> gpio: mockup: Replace custom devm_gpiochip_dispose_irq_mappings()
> gpio: sim: Replace custom devm_gpiochip_dispose_irq_mappings()
>
> drivers/gpio/gpio-mockup.c | 15 +--------------
> drivers/gpio/gpio-sim.c | 17 ++++-------------
> drivers/gpio/gpiolib-devres.c | 33 +++++++++++++++++++++++++++++++++
> include/linux/gpio/driver.h | 4 ++++
> 4 files changed, 42 insertions(+), 27 deletions(-)
>
> --
> 2.50.1
>
Linus' responses reminded me about this series and I realized I don't
really like the fact you hide the call to devm_add_action_or_reset()
behind the new interface. I'd prefer to keep devm_add_action_or_reset()
and add gpiochip_dispose_irq_mappings() that can be independently
scheduled by each user.
Seeing a devm_something() makes me think, it allocates something that
will be released at unbind(), which isn't really the case here, we
really do schedule an "action". I'd prefer it be explicit.
Bart