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

gpio: cadence: Convert to immutable irq_chip

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

Cc: Marc Zyngier <maz@kernel.org>
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
150a9880 b11ce7e4

+7 -3
+7 -3
drivers/gpio/gpio-cadence.c
··· 70 70 struct cdns_gpio_chip *cgpio = gpiochip_get_data(chip); 71 71 72 72 iowrite32(BIT(d->hwirq), cgpio->regs + CDNS_GPIO_IRQ_DIS); 73 + gpiochip_disable_irq(chip, irqd_to_hwirq(d)); 73 74 } 74 75 75 76 static void cdns_gpio_irq_unmask(struct irq_data *d) ··· 78 77 struct gpio_chip *chip = irq_data_get_irq_chip_data(d); 79 78 struct cdns_gpio_chip *cgpio = gpiochip_get_data(chip); 80 79 80 + gpiochip_enable_irq(chip, irqd_to_hwirq(d)); 81 81 iowrite32(BIT(d->hwirq), cgpio->regs + CDNS_GPIO_IRQ_EN); 82 82 } 83 83 ··· 140 138 chained_irq_exit(irqchip, desc); 141 139 } 142 140 143 - static struct irq_chip cdns_gpio_irqchip = { 141 + static const struct irq_chip cdns_gpio_irqchip = { 144 142 .name = "cdns-gpio", 145 143 .irq_mask = cdns_gpio_irq_mask, 146 144 .irq_unmask = cdns_gpio_irq_unmask, 147 - .irq_set_type = cdns_gpio_irq_set_type 145 + .irq_set_type = cdns_gpio_irq_set_type, 146 + .flags = IRQCHIP_IMMUTABLE, 147 + GPIOCHIP_IRQ_RESOURCE_HELPERS, 148 148 }; 149 149 150 150 static int cdns_gpio_probe(struct platform_device *pdev) ··· 226 222 struct gpio_irq_chip *girq; 227 223 228 224 girq = &cgpio->gc.irq; 229 - girq->chip = &cdns_gpio_irqchip; 225 + gpio_irq_chip_set_chip(girq, &cdns_gpio_irqchip); 230 226 girq->parent_handler = cdns_gpio_irq_handler; 231 227 girq->num_parents = 1; 232 228 girq->parents = devm_kcalloc(&pdev->dev, 1,