* [PATCH] pinctrl: nuvoton: wpcm450: Convert irqchip to IRQCHIP_IMMUTABLE
@ 2022-06-06 21:43 Jonathan Neuschäfer
2022-06-07 7:29 ` Marc Zyngier
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Neuschäfer @ 2022-06-06 21:43 UTC (permalink / raw)
To: linux-gpio
Cc: Marc Zyngier, Jonathan Neuschäfer, Linus Walleij, openbmc,
linux-kernel
Commit 6c846d026d490 ("gpio: Don't fiddle with irqchips marked as
immutable") added a warning for irqchips that are not marked with
IRQCHIP_IMMUTABLE.
Convert the pinctrl-wpcm450 driver to an immutable irqchip.
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
---
drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
index 0dbeb91f0bf27..cff784a7ce4d7 100644
--- a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
+++ b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
@@ -293,6 +293,8 @@ static const struct irq_chip wpcm450_gpio_irqchip = {
.irq_unmask = wpcm450_gpio_irq_unmask,
.irq_mask = wpcm450_gpio_irq_mask,
.irq_set_type = wpcm450_gpio_set_irq_type,
+ .flags = IRQCHIP_IMMUTABLE,
+ GPIOCHIP_IRQ_RESOURCE_HELPERS,
};
static void wpcm450_gpio_irqhandler(struct irq_desc *desc)
@@ -1068,9 +1070,8 @@ static int wpcm450_gpio_register(struct platform_device *pdev,
gpio->gc.fwnode = child;
gpio->gc.add_pin_ranges = wpcm450_gpio_add_pin_ranges;
- gpio->irqc = wpcm450_gpio_irqchip;
girq = &gpio->gc.irq;
- girq->chip = &gpio->irqc;
+ gpio_irq_chip_set_chip(girq, &wpcm450_gpio_irqchip);
girq->parent_handler = wpcm450_gpio_irqhandler;
girq->parents = devm_kcalloc(dev, WPCM450_NUM_GPIO_IRQS,
sizeof(*girq->parents), GFP_KERNEL);
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] pinctrl: nuvoton: wpcm450: Convert irqchip to IRQCHIP_IMMUTABLE
2022-06-06 21:43 [PATCH] pinctrl: nuvoton: wpcm450: Convert irqchip to IRQCHIP_IMMUTABLE Jonathan Neuschäfer
@ 2022-06-07 7:29 ` Marc Zyngier
2022-06-07 8:43 ` Jonathan Neuschäfer
0 siblings, 1 reply; 3+ messages in thread
From: Marc Zyngier @ 2022-06-07 7:29 UTC (permalink / raw)
To: Jonathan Neuschäfer; +Cc: linux-gpio, Linus Walleij, openbmc, linux-kernel
On Mon, 06 Jun 2022 22:43:00 +0100,
Jonathan Neuschäfer <j.neuschaefer@gmx.net> wrote:
>
> Commit 6c846d026d490 ("gpio: Don't fiddle with irqchips marked as
> immutable") added a warning for irqchips that are not marked with
> IRQCHIP_IMMUTABLE.
>
> Convert the pinctrl-wpcm450 driver to an immutable irqchip.
>
> Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
> ---
> drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
> index 0dbeb91f0bf27..cff784a7ce4d7 100644
> --- a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
> +++ b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
> @@ -293,6 +293,8 @@ static const struct irq_chip wpcm450_gpio_irqchip = {
> .irq_unmask = wpcm450_gpio_irq_unmask,
> .irq_mask = wpcm450_gpio_irq_mask,
> .irq_set_type = wpcm450_gpio_set_irq_type,
> + .flags = IRQCHIP_IMMUTABLE,
> + GPIOCHIP_IRQ_RESOURCE_HELPERS,
> };
>
> static void wpcm450_gpio_irqhandler(struct irq_desc *desc)
> @@ -1068,9 +1070,8 @@ static int wpcm450_gpio_register(struct platform_device *pdev,
> gpio->gc.fwnode = child;
> gpio->gc.add_pin_ranges = wpcm450_gpio_add_pin_ranges;
>
> - gpio->irqc = wpcm450_gpio_irqchip;
> girq = &gpio->gc.irq;
> - girq->chip = &gpio->irqc;
> + gpio_irq_chip_set_chip(girq, &wpcm450_gpio_irqchip);
> girq->parent_handler = wpcm450_gpio_irqhandler;
> girq->parents = devm_kcalloc(dev, WPCM450_NUM_GPIO_IRQS,
> sizeof(*girq->parents), GFP_KERNEL);
You are definitely missing the required updates to the mask/unmask
methods, and you still have a now useless irq_chip structure in
wpcm450_gpio.
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] pinctrl: nuvoton: wpcm450: Convert irqchip to IRQCHIP_IMMUTABLE
2022-06-07 7:29 ` Marc Zyngier
@ 2022-06-07 8:43 ` Jonathan Neuschäfer
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Neuschäfer @ 2022-06-07 8:43 UTC (permalink / raw)
To: Marc Zyngier
Cc: Jonathan Neuschäfer, linux-gpio, Linus Walleij, openbmc,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1951 bytes --]
On Tue, Jun 07, 2022 at 08:29:05AM +0100, Marc Zyngier wrote:
> On Mon, 06 Jun 2022 22:43:00 +0100,
> Jonathan Neuschäfer <j.neuschaefer@gmx.net> wrote:
> >
> > Commit 6c846d026d490 ("gpio: Don't fiddle with irqchips marked as
> > immutable") added a warning for irqchips that are not marked with
> > IRQCHIP_IMMUTABLE.
> >
> > Convert the pinctrl-wpcm450 driver to an immutable irqchip.
> >
> > Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
> > ---
> > drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
> > index 0dbeb91f0bf27..cff784a7ce4d7 100644
> > --- a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
> > +++ b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
> > @@ -293,6 +293,8 @@ static const struct irq_chip wpcm450_gpio_irqchip = {
> > .irq_unmask = wpcm450_gpio_irq_unmask,
> > .irq_mask = wpcm450_gpio_irq_mask,
> > .irq_set_type = wpcm450_gpio_set_irq_type,
> > + .flags = IRQCHIP_IMMUTABLE,
> > + GPIOCHIP_IRQ_RESOURCE_HELPERS,
> > };
> >
> > static void wpcm450_gpio_irqhandler(struct irq_desc *desc)
> > @@ -1068,9 +1070,8 @@ static int wpcm450_gpio_register(struct platform_device *pdev,
> > gpio->gc.fwnode = child;
> > gpio->gc.add_pin_ranges = wpcm450_gpio_add_pin_ranges;
> >
> > - gpio->irqc = wpcm450_gpio_irqchip;
> > girq = &gpio->gc.irq;
> > - girq->chip = &gpio->irqc;
> > + gpio_irq_chip_set_chip(girq, &wpcm450_gpio_irqchip);
> > girq->parent_handler = wpcm450_gpio_irqhandler;
> > girq->parents = devm_kcalloc(dev, WPCM450_NUM_GPIO_IRQS,
> > sizeof(*girq->parents), GFP_KERNEL);
>
> You are definitely missing the required updates to the mask/unmask
> methods, and you still have a now useless irq_chip structure in
> wpcm450_gpio.
Ah, true.
Thanks,
Jonathan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-06-07 8:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-06 21:43 [PATCH] pinctrl: nuvoton: wpcm450: Convert irqchip to IRQCHIP_IMMUTABLE Jonathan Neuschäfer
2022-06-07 7:29 ` Marc Zyngier
2022-06-07 8:43 ` Jonathan Neuschäfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).