gpio: Move irqchip into struct gpio_irq_chip
In order to consolidate the multiple ways to associate an IRQ chip with a GPIO chip, move more fields into the new struct gpio_irq_chip. Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:

committed by
Linus Walleij

parent
c44eafd79b
commit
da80ff81a8
@@ -1646,7 +1646,7 @@ static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq,
|
||||
* category than their parents, so it won't report false recursion.
|
||||
*/
|
||||
irq_set_lockdep_class(irq, chip->lock_key);
|
||||
irq_set_chip_and_handler(irq, chip->irqchip, chip->irq_handler);
|
||||
irq_set_chip_and_handler(irq, chip->irq.chip, chip->irq_handler);
|
||||
/* Chips that use nested thread handlers have them marked */
|
||||
if (chip->irq_nested)
|
||||
irq_set_nested_thread(irq, 1);
|
||||
@@ -1739,10 +1739,10 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip)
|
||||
irq_domain_remove(gpiochip->irqdomain);
|
||||
}
|
||||
|
||||
if (gpiochip->irqchip) {
|
||||
gpiochip->irqchip->irq_request_resources = NULL;
|
||||
gpiochip->irqchip->irq_release_resources = NULL;
|
||||
gpiochip->irqchip = NULL;
|
||||
if (gpiochip->irq.chip) {
|
||||
gpiochip->irq.chip->irq_request_resources = NULL;
|
||||
gpiochip->irq.chip->irq_release_resources = NULL;
|
||||
gpiochip->irq.chip = NULL;
|
||||
}
|
||||
|
||||
gpiochip_irqchip_free_valid_mask(gpiochip);
|
||||
@@ -1817,7 +1817,7 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gpiochip,
|
||||
type = IRQ_TYPE_NONE;
|
||||
}
|
||||
|
||||
gpiochip->irqchip = irqchip;
|
||||
gpiochip->irq.chip = irqchip;
|
||||
gpiochip->irq_handler = handler;
|
||||
gpiochip->irq_default_type = type;
|
||||
gpiochip->to_irq = gpiochip_to_irq;
|
||||
@@ -1826,7 +1826,7 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gpiochip,
|
||||
gpiochip->ngpio, first_irq,
|
||||
&gpiochip_domain_ops, gpiochip);
|
||||
if (!gpiochip->irqdomain) {
|
||||
gpiochip->irqchip = NULL;
|
||||
gpiochip->irq.chip = NULL;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user