Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: idt3243x: Convert to immutable irq_chip

Convert the driver to immutable irq-chip with a bit of
intuition.

Cc: Marc Zyngier <maz@kernel.org>
Tested-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Acked-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

Linus Walleij and committed by
Bartosz Golaszewski
9cd9e23a ab42f021

+8 -3
+8 -3
drivers/gpio/gpio-idt3243x.c
··· 92 92 writel(ctrl->mask_cache, ctrl->pic + IDT_PIC_IRQ_MASK); 93 93 94 94 raw_spin_unlock_irqrestore(&gc->bgpio_lock, flags); 95 + 96 + gpiochip_disable_irq(gc, irqd_to_hwirq(d)); 95 97 } 96 98 97 99 static void idt_gpio_unmask(struct irq_data *d) ··· 102 100 struct idt_gpio_ctrl *ctrl = gpiochip_get_data(gc); 103 101 unsigned long flags; 104 102 103 + gpiochip_enable_irq(gc, irqd_to_hwirq(d)); 105 104 raw_spin_lock_irqsave(&gc->bgpio_lock, flags); 106 105 107 106 ctrl->mask_cache &= ~BIT(d->hwirq); ··· 122 119 return 0; 123 120 } 124 121 125 - static struct irq_chip idt_gpio_irqchip = { 122 + static const struct irq_chip idt_gpio_irqchip = { 126 123 .name = "IDTGPIO", 127 124 .irq_mask = idt_gpio_mask, 128 125 .irq_ack = idt_gpio_ack, 129 126 .irq_unmask = idt_gpio_unmask, 130 - .irq_set_type = idt_gpio_irq_set_type 127 + .irq_set_type = idt_gpio_irq_set_type, 128 + .flags = IRQCHIP_IMMUTABLE, 129 + GPIOCHIP_IRQ_RESOURCE_HELPERS, 131 130 }; 132 131 133 132 static int idt_gpio_probe(struct platform_device *pdev) ··· 173 168 return parent_irq; 174 169 175 170 girq = &ctrl->gc.irq; 176 - girq->chip = &idt_gpio_irqchip; 171 + gpio_irq_chip_set_chip(girq, &idt_gpio_irqchip); 177 172 girq->init_hw = idt_gpio_irq_init_hw; 178 173 girq->parent_handler = idt_gpio_dispatch; 179 174 girq->num_parents = 1;