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

gpio: tc3589x: Make irqchip immutable

This turns the Toshiba tc3589x gpio irqchip immutable.

Cc: Marc Zyngier <maz@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>

authored by

Linus Walleij and committed by
Bartosz Golaszewski
3c92506d 0ae3109a

+6 -2
+6 -2
drivers/gpio/gpio-tc3589x.c
··· 230 230 231 231 tc3589x_gpio->regs[REG_IE][regoffset] &= ~mask; 232 232 tc3589x_gpio->regs[REG_DIRECT][regoffset] |= mask; 233 + gpiochip_disable_irq(gc, offset); 233 234 } 234 235 235 236 static void tc3589x_gpio_irq_unmask(struct irq_data *d) ··· 241 240 int regoffset = offset / 8; 242 241 int mask = BIT(offset % 8); 243 242 243 + gpiochip_enable_irq(gc, offset); 244 244 tc3589x_gpio->regs[REG_IE][regoffset] |= mask; 245 245 tc3589x_gpio->regs[REG_DIRECT][regoffset] &= ~mask; 246 246 } 247 247 248 - static struct irq_chip tc3589x_gpio_irq_chip = { 248 + static const struct irq_chip tc3589x_gpio_irq_chip = { 249 249 .name = "tc3589x-gpio", 250 250 .irq_bus_lock = tc3589x_gpio_irq_lock, 251 251 .irq_bus_sync_unlock = tc3589x_gpio_irq_sync_unlock, 252 252 .irq_mask = tc3589x_gpio_irq_mask, 253 253 .irq_unmask = tc3589x_gpio_irq_unmask, 254 254 .irq_set_type = tc3589x_gpio_irq_set_type, 255 + .flags = IRQCHIP_IMMUTABLE, 256 + GPIOCHIP_IRQ_RESOURCE_HELPERS, 255 257 }; 256 258 257 259 static irqreturn_t tc3589x_gpio_irq(int irq, void *dev) ··· 325 321 tc3589x_gpio->chip.base = -1; 326 322 327 323 girq = &tc3589x_gpio->chip.irq; 328 - girq->chip = &tc3589x_gpio_irq_chip; 324 + gpio_irq_chip_set_chip(girq, &tc3589x_gpio_irq_chip); 329 325 /* This will let us handle the parent IRQ in the driver */ 330 326 girq->parent_handler = NULL; 331 327 girq->num_parents = 0;