Commit a80fed9f authored by Andy Shevchenko's avatar Andy Shevchenko

gpio: merrifield: 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>
parent 41a18c49
...@@ -220,10 +220,8 @@ static void mrfld_irq_ack(struct irq_data *d) ...@@ -220,10 +220,8 @@ static void mrfld_irq_ack(struct irq_data *d)
raw_spin_unlock_irqrestore(&priv->lock, flags); raw_spin_unlock_irqrestore(&priv->lock, flags);
} }
static void mrfld_irq_unmask_mask(struct irq_data *d, bool unmask) static void mrfld_irq_unmask_mask(struct mrfld_gpio *priv, u32 gpio, bool unmask)
{ {
struct mrfld_gpio *priv = irq_data_get_irq_chip_data(d);
u32 gpio = irqd_to_hwirq(d);
void __iomem *gimr = gpio_reg(&priv->chip, gpio, GIMR); void __iomem *gimr = gpio_reg(&priv->chip, gpio, GIMR);
unsigned long flags; unsigned long flags;
u32 value; u32 value;
...@@ -241,12 +239,20 @@ static void mrfld_irq_unmask_mask(struct irq_data *d, bool unmask) ...@@ -241,12 +239,20 @@ static void mrfld_irq_unmask_mask(struct irq_data *d, bool unmask)
static void mrfld_irq_mask(struct irq_data *d) static void mrfld_irq_mask(struct irq_data *d)
{ {
mrfld_irq_unmask_mask(d, false); struct mrfld_gpio *priv = irq_data_get_irq_chip_data(d);
u32 gpio = irqd_to_hwirq(d);
mrfld_irq_unmask_mask(priv, gpio, false);
gpiochip_disable_irq(&priv->chip, gpio);
} }
static void mrfld_irq_unmask(struct irq_data *d) static void mrfld_irq_unmask(struct irq_data *d)
{ {
mrfld_irq_unmask_mask(d, true); struct mrfld_gpio *priv = irq_data_get_irq_chip_data(d);
u32 gpio = irqd_to_hwirq(d);
gpiochip_enable_irq(&priv->chip, gpio);
mrfld_irq_unmask_mask(priv, gpio, true);
} }
static int mrfld_irq_set_type(struct irq_data *d, unsigned int type) static int mrfld_irq_set_type(struct irq_data *d, unsigned int type)
...@@ -329,13 +335,15 @@ static int mrfld_irq_set_wake(struct irq_data *d, unsigned int on) ...@@ -329,13 +335,15 @@ static int mrfld_irq_set_wake(struct irq_data *d, unsigned int on)
return 0; return 0;
} }
static struct irq_chip mrfld_irqchip = { static const struct irq_chip mrfld_irqchip = {
.name = "gpio-merrifield", .name = "gpio-merrifield",
.irq_ack = mrfld_irq_ack, .irq_ack = mrfld_irq_ack,
.irq_mask = mrfld_irq_mask, .irq_mask = mrfld_irq_mask,
.irq_unmask = mrfld_irq_unmask, .irq_unmask = mrfld_irq_unmask,
.irq_set_type = mrfld_irq_set_type, .irq_set_type = mrfld_irq_set_type,
.irq_set_wake = mrfld_irq_set_wake, .irq_set_wake = mrfld_irq_set_wake,
.flags = IRQCHIP_IMMUTABLE,
GPIOCHIP_IRQ_RESOURCE_HELPERS,
}; };
static void mrfld_irq_handler(struct irq_desc *desc) static void mrfld_irq_handler(struct irq_desc *desc)
...@@ -482,7 +490,7 @@ static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id ...@@ -482,7 +490,7 @@ static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id
return retval; return retval;
girq = &priv->chip.irq; girq = &priv->chip.irq;
girq->chip = &mrfld_irqchip; gpio_irq_chip_set_chip(girq, &mrfld_irqchip);
girq->init_hw = mrfld_irq_init_hw; girq->init_hw = mrfld_irq_init_hw;
girq->parent_handler = mrfld_irq_handler; girq->parent_handler = mrfld_irq_handler;
girq->num_parents = 1; girq->num_parents = 1;
......
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