Re: [PATCH] gpio: mt7621: fix interrupt banks mapping on gpio chips

From: Bartosz Golaszewski

Date: Wed May 27 2026 - 04:52:09 EST


On Tue, 26 May 2026 15:12:43 +0200, Sergio Paracuellos
<sergio.paracuellos@xxxxxxxxx> said:
>
> Device tree is using two cells for this, so only the interrupt pin and the
> interrupt type are described there. Changing to have three cells to setup
> also the bank and implement 'of_node_instance_match()' would also work but
> this would be an ABI breakage and also a bit incoherent since gpios itself
> are also using two cells and properly mapped in desired bank using through
> its pin number on 'of_xlate()'.
>
> That said, the solution adopted here is registering register a linear IRQ

s/registering register/registering/ but better just use imperative tone:
"Register a linear IRQ..."

...

> for (i = 0; i < MTK_BANK_CNT; i++) {
> @@ -331,7 +466,17 @@ mediatek_gpio_probe(struct platform_device *pdev)
> return ret;
> }
>
> + if (mtk->gpio_irq > 0) {
> + ret = mt7621_gpio_irq_setup(pdev, mtk);
> + if (ret)
> + goto fail;
> + }
> +
> return 0;
> +
> +fail:
> + mt7621_gpio_remove(pdev);

Don't you need to undo this in remove path as well?

The approach looks sane to me. I'll give some time for tglx or linusw to
respond before queueing it for fixes.

Bart