Commit 41a18c49 authored by Andy Shevchenko's avatar Andy Shevchenko

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarKuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
parent 68a12c19
...@@ -299,6 +299,8 @@ static void wcove_irq_unmask(struct irq_data *data) ...@@ -299,6 +299,8 @@ static void wcove_irq_unmask(struct irq_data *data)
if (gpio >= WCOVE_GPIO_NUM) if (gpio >= WCOVE_GPIO_NUM)
return; return;
gpiochip_enable_irq(chip, gpio);
wg->set_irq_mask = false; wg->set_irq_mask = false;
wg->update |= UPDATE_IRQ_MASK; wg->update |= UPDATE_IRQ_MASK;
} }
...@@ -314,15 +316,19 @@ static void wcove_irq_mask(struct irq_data *data) ...@@ -314,15 +316,19 @@ static void wcove_irq_mask(struct irq_data *data)
wg->set_irq_mask = true; wg->set_irq_mask = true;
wg->update |= UPDATE_IRQ_MASK; wg->update |= UPDATE_IRQ_MASK;
gpiochip_disable_irq(chip, gpio);
} }
static struct irq_chip wcove_irqchip = { static const struct irq_chip wcove_irqchip = {
.name = "Whiskey Cove", .name = "Whiskey Cove",
.irq_mask = wcove_irq_mask, .irq_mask = wcove_irq_mask,
.irq_unmask = wcove_irq_unmask, .irq_unmask = wcove_irq_unmask,
.irq_set_type = wcove_irq_type, .irq_set_type = wcove_irq_type,
.irq_bus_lock = wcove_bus_lock, .irq_bus_lock = wcove_bus_lock,
.irq_bus_sync_unlock = wcove_bus_sync_unlock, .irq_bus_sync_unlock = wcove_bus_sync_unlock,
.flags = IRQCHIP_IMMUTABLE,
GPIOCHIP_IRQ_RESOURCE_HELPERS,
}; };
static irqreturn_t wcove_gpio_irq_handler(int irq, void *data) static irqreturn_t wcove_gpio_irq_handler(int irq, void *data)
...@@ -452,7 +458,7 @@ static int wcove_gpio_probe(struct platform_device *pdev) ...@@ -452,7 +458,7 @@ static int wcove_gpio_probe(struct platform_device *pdev)
} }
girq = &wg->chip.irq; girq = &wg->chip.irq;
girq->chip = &wcove_irqchip; gpio_irq_chip_set_chip(girq, &wcove_irqchip);
/* This will let us handle the parent IRQ in the driver */ /* This will let us handle the parent IRQ in the driver */
girq->parent_handler = NULL; girq->parent_handler = NULL;
girq->num_parents = 0; girq->num_parents = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment