Skip to content

Commit 41a18c4

Browse files
committed
gpio: wcove: make irq_chip immutable
Since recently, the kernel is nagging about mutable irq_chips: "not an immutable chip, please consider fixing it!" Drop the unneeded copy, flag it as IRQCHIP_IMMUTABLE, add the new helper functions and call the appropriate gpiolib functions. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Kuppuswamy Sathyanarayanan <[email protected]>
1 parent 68a12c1 commit 41a18c4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/gpio/gpio-wcove.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ static void wcove_irq_unmask(struct irq_data *data)
299299
if (gpio >= WCOVE_GPIO_NUM)
300300
return;
301301

302+
gpiochip_enable_irq(chip, gpio);
303+
302304
wg->set_irq_mask = false;
303305
wg->update |= UPDATE_IRQ_MASK;
304306
}
@@ -314,15 +316,19 @@ static void wcove_irq_mask(struct irq_data *data)
314316

315317
wg->set_irq_mask = true;
316318
wg->update |= UPDATE_IRQ_MASK;
319+
320+
gpiochip_disable_irq(chip, gpio);
317321
}
318322

319-
static struct irq_chip wcove_irqchip = {
323+
static const struct irq_chip wcove_irqchip = {
320324
.name = "Whiskey Cove",
321325
.irq_mask = wcove_irq_mask,
322326
.irq_unmask = wcove_irq_unmask,
323327
.irq_set_type = wcove_irq_type,
324328
.irq_bus_lock = wcove_bus_lock,
325329
.irq_bus_sync_unlock = wcove_bus_sync_unlock,
330+
.flags = IRQCHIP_IMMUTABLE,
331+
GPIOCHIP_IRQ_RESOURCE_HELPERS,
326332
};
327333

328334
static irqreturn_t wcove_gpio_irq_handler(int irq, void *data)
@@ -452,7 +458,7 @@ static int wcove_gpio_probe(struct platform_device *pdev)
452458
}
453459

454460
girq = &wg->chip.irq;
455-
girq->chip = &wcove_irqchip;
461+
gpio_irq_chip_set_chip(girq, &wcove_irqchip);
456462
/* This will let us handle the parent IRQ in the driver */
457463
girq->parent_handler = NULL;
458464
girq->num_parents = 0;

0 commit comments

Comments
 (0)