Skip to content

Commit 51ff939

Browse files
mwalleMarc Zyngier
authored andcommitted
pinctrl: ocelot: Make irq_chip immutable
Since recently, the kernel is nagging about mutable irq_chips: [ 2.593426] gpio gpiochip0: (ocelot-gpio): not an immutable chip, please consider fixing it! Make it const, flag it as IRQCHIP_IMMUTABLE, add the new helper functions and call the appropriate gpiolib functions. Signed-off-by: Michael Walle <michael@walle.cc> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220706151553.1580790-2-michael@walle.cc
1 parent ef6e5d6 commit 51ff939

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/pinctrl/pinctrl-ocelot.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,6 +1761,7 @@ static void ocelot_irq_mask(struct irq_data *data)
17611761

17621762
regmap_update_bits(info->map, REG(OCELOT_GPIO_INTR_ENA, info, gpio),
17631763
BIT(gpio % 32), 0);
1764+
gpiochip_disable_irq(chip, gpio);
17641765
}
17651766

17661767
static void ocelot_irq_unmask(struct irq_data *data)
@@ -1769,6 +1770,7 @@ static void ocelot_irq_unmask(struct irq_data *data)
17691770
struct ocelot_pinctrl *info = gpiochip_get_data(chip);
17701771
unsigned int gpio = irqd_to_hwirq(data);
17711772

1773+
gpiochip_enable_irq(chip, gpio);
17721774
regmap_update_bits(info->map, REG(OCELOT_GPIO_INTR_ENA, info, gpio),
17731775
BIT(gpio % 32), BIT(gpio % 32));
17741776
}
@@ -1790,8 +1792,10 @@ static struct irq_chip ocelot_eoi_irqchip = {
17901792
.irq_mask = ocelot_irq_mask,
17911793
.irq_eoi = ocelot_irq_ack,
17921794
.irq_unmask = ocelot_irq_unmask,
1793-
.flags = IRQCHIP_EOI_THREADED | IRQCHIP_EOI_IF_HANDLED,
1795+
.flags = IRQCHIP_EOI_THREADED | IRQCHIP_EOI_IF_HANDLED |
1796+
IRQCHIP_IMMUTABLE,
17941797
.irq_set_type = ocelot_irq_set_type,
1798+
GPIOCHIP_IRQ_RESOURCE_HELPERS
17951799
};
17961800

17971801
static struct irq_chip ocelot_irqchip = {
@@ -1800,6 +1804,8 @@ static struct irq_chip ocelot_irqchip = {
18001804
.irq_ack = ocelot_irq_ack,
18011805
.irq_unmask = ocelot_irq_unmask,
18021806
.irq_set_type = ocelot_irq_set_type,
1807+
.flags = IRQCHIP_IMMUTABLE,
1808+
GPIOCHIP_IRQ_RESOURCE_HELPERS
18031809
};
18041810

18051811
static int ocelot_irq_set_type(struct irq_data *data, unsigned int type)
@@ -1863,7 +1869,7 @@ static int ocelot_gpiochip_register(struct platform_device *pdev,
18631869
irq = platform_get_irq_optional(pdev, 0);
18641870
if (irq > 0) {
18651871
girq = &gc->irq;
1866-
girq->chip = &ocelot_irqchip;
1872+
gpio_irq_chip_set_chip(girq, &ocelot_irqchip);
18671873
girq->parent_handler = ocelot_irq_handler;
18681874
girq->num_parents = 1;
18691875
girq->parents = devm_kcalloc(&pdev->dev, 1,

0 commit comments

Comments
 (0)