* [PATCH] gpio: tc3589x: Make irqchip immutable
@ 2022-09-26 9:30 Linus Walleij
2022-09-26 9:37 ` Marc Zyngier
0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2022-09-26 9:30 UTC (permalink / raw)
To: linux-gpio, Bartosz Golaszewski; +Cc: Linus Walleij, Marc Zyngier
This turns the Toshiba tc3589x gpio irqchip immutable.
Cc: Marc Zyngier <maz@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/gpio/gpio-tc3589x.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c
index 443fe975bf13..f9edb720710a 100644
--- a/drivers/gpio/gpio-tc3589x.c
+++ b/drivers/gpio/gpio-tc3589x.c
@@ -244,13 +244,15 @@ static void tc3589x_gpio_irq_unmask(struct irq_data *d)
tc3589x_gpio->regs[REG_DIRECT][regoffset] &= ~mask;
}
-static struct irq_chip tc3589x_gpio_irq_chip = {
+static const struct irq_chip tc3589x_gpio_irq_chip = {
.name = "tc3589x-gpio",
.irq_bus_lock = tc3589x_gpio_irq_lock,
.irq_bus_sync_unlock = tc3589x_gpio_irq_sync_unlock,
.irq_mask = tc3589x_gpio_irq_mask,
.irq_unmask = tc3589x_gpio_irq_unmask,
.irq_set_type = tc3589x_gpio_irq_set_type,
+ .flags = IRQCHIP_IMMUTABLE,
+ GPIOCHIP_IRQ_RESOURCE_HELPERS,
};
static irqreturn_t tc3589x_gpio_irq(int irq, void *dev)
@@ -321,7 +323,7 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
tc3589x_gpio->chip.base = -1;
girq = &tc3589x_gpio->chip.irq;
- girq->chip = &tc3589x_gpio_irq_chip;
+ gpio_irq_chip_set_chip(girq, &tc3589x_gpio_irq_chip);
/* This will let us handle the parent IRQ in the driver */
girq->parent_handler = NULL;
girq->num_parents = 0;
--
2.37.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gpio: tc3589x: Make irqchip immutable
2022-09-26 9:30 [PATCH] gpio: tc3589x: Make irqchip immutable Linus Walleij
@ 2022-09-26 9:37 ` Marc Zyngier
0 siblings, 0 replies; 2+ messages in thread
From: Marc Zyngier @ 2022-09-26 9:37 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-gpio, Bartosz Golaszewski
On Mon, 26 Sep 2022 10:30:47 +0100,
Linus Walleij <linus.walleij@linaro.org> wrote:
>
> This turns the Toshiba tc3589x gpio irqchip immutable.
>
> Cc: Marc Zyngier <maz@kernel.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> drivers/gpio/gpio-tc3589x.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c
> index 443fe975bf13..f9edb720710a 100644
> --- a/drivers/gpio/gpio-tc3589x.c
> +++ b/drivers/gpio/gpio-tc3589x.c
> @@ -244,13 +244,15 @@ static void tc3589x_gpio_irq_unmask(struct irq_data *d)
> tc3589x_gpio->regs[REG_DIRECT][regoffset] &= ~mask;
> }
>
> -static struct irq_chip tc3589x_gpio_irq_chip = {
> +static const struct irq_chip tc3589x_gpio_irq_chip = {
> .name = "tc3589x-gpio",
> .irq_bus_lock = tc3589x_gpio_irq_lock,
> .irq_bus_sync_unlock = tc3589x_gpio_irq_sync_unlock,
> .irq_mask = tc3589x_gpio_irq_mask,
> .irq_unmask = tc3589x_gpio_irq_unmask,
Don't you need to update these two methods with the callbacks into the
gpiolib core code?
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-26 9:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-26 9:30 [PATCH] gpio: tc3589x: Make irqchip immutable Linus Walleij
2022-09-26 9:37 ` Marc Zyngier
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).