Skip to content

Commit 20117cf

Browse files
MrVanBartosz Golaszewski
authored andcommitted
gpio: pxa: Make irq_chip immutable
Kernel warns about mutable irq_chips: "not an immutable chip, please consider fixing!" Constify pxa_muxed_gpio_chip, flag the irq_chip as IRQCHIP_IMMUTABLE, add the new helper functions, and call the appropriate gpiolib functions. Signed-off-by: Peng Fan <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 2993d2d commit 20117cf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/gpio/gpio-pxa.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,8 @@ static void pxa_mask_muxed_gpio(struct irq_data *d)
497497
gfer = readl_relaxed(base + GFER_OFFSET) & ~GPIO_bit(gpio);
498498
writel_relaxed(grer, base + GRER_OFFSET);
499499
writel_relaxed(gfer, base + GFER_OFFSET);
500+
501+
gpiochip_disable_irq(&pchip->chip, gpio);
500502
}
501503

502504
static int pxa_gpio_set_wake(struct irq_data *d, unsigned int on)
@@ -516,17 +518,21 @@ static void pxa_unmask_muxed_gpio(struct irq_data *d)
516518
unsigned int gpio = irqd_to_hwirq(d);
517519
struct pxa_gpio_bank *c = gpio_to_pxabank(&pchip->chip, gpio);
518520

521+
gpiochip_enable_irq(&pchip->chip, gpio);
522+
519523
c->irq_mask |= GPIO_bit(gpio);
520524
update_edge_detect(c);
521525
}
522526

523-
static struct irq_chip pxa_muxed_gpio_chip = {
527+
static const struct irq_chip pxa_muxed_gpio_chip = {
524528
.name = "GPIO",
525529
.irq_ack = pxa_ack_muxed_gpio,
526530
.irq_mask = pxa_mask_muxed_gpio,
527531
.irq_unmask = pxa_unmask_muxed_gpio,
528532
.irq_set_type = pxa_gpio_irq_type,
529533
.irq_set_wake = pxa_gpio_set_wake,
534+
.flags = IRQCHIP_IMMUTABLE,
535+
GPIOCHIP_IRQ_RESOURCE_HELPERS,
530536
};
531537

532538
static int pxa_gpio_nums(struct platform_device *pdev)

0 commit comments

Comments
 (0)