diff options
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpiolib.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 2ce3df3504e6..59cb4303e251 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -443,6 +443,8 @@ void gpiochip_set_chained_irqchip(struct gpio_chip *gpiochip, | |||
443 | */ | 443 | */ |
444 | irq_set_handler_data(parent_irq, gpiochip); | 444 | irq_set_handler_data(parent_irq, gpiochip); |
445 | irq_set_chained_handler(parent_irq, parent_handler); | 445 | irq_set_chained_handler(parent_irq, parent_handler); |
446 | |||
447 | gpiochip->irq_parent = parent_irq; | ||
446 | } | 448 | } |
447 | 449 | ||
448 | /* Set the parent IRQ for all affected IRQs */ | 450 | /* Set the parent IRQ for all affected IRQs */ |
@@ -551,6 +553,11 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip) | |||
551 | 553 | ||
552 | acpi_gpiochip_free_interrupts(gpiochip); | 554 | acpi_gpiochip_free_interrupts(gpiochip); |
553 | 555 | ||
556 | if (gpiochip->irq_parent) { | ||
557 | irq_set_chained_handler(gpiochip->irq_parent, NULL); | ||
558 | irq_set_handler_data(gpiochip->irq_parent, NULL); | ||
559 | } | ||
560 | |||
554 | /* Remove all IRQ mappings and delete the domain */ | 561 | /* Remove all IRQ mappings and delete the domain */ |
555 | if (gpiochip->irqdomain) { | 562 | if (gpiochip->irqdomain) { |
556 | for (offset = 0; offset < gpiochip->ngpio; offset++) | 563 | for (offset = 0; offset < gpiochip->ngpio; offset++) |