diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2015-05-12 20:12:23 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-05-13 13:02:36 +0200 |
commit | 25e4fe92a20bbffde87500615250f1d54bfb832f (patch) | |
tree | f879e7336fc3a2347689df9f18e1ac0a51e34a4e /drivers/gpio | |
parent | 845c877009cf014b971aab7f54613f9185a824b0 (diff) | |
download | blackbird-op-linux-25e4fe92a20bbffde87500615250f1d54bfb832f.tar.gz blackbird-op-linux-25e4fe92a20bbffde87500615250f1d54bfb832f.zip |
gpiolib: cleanup chained handler and data
Clean up chained handler and handler data if they were set by
gpiochip_set_chained_irqchip().
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
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, */ irq_set_handler_data(parent_irq, gpiochip); irq_set_chained_handler(parent_irq, parent_handler); + + gpiochip->irq_parent = parent_irq; } /* Set the parent IRQ for all affected IRQs */ @@ -551,6 +553,11 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip) acpi_gpiochip_free_interrupts(gpiochip); + if (gpiochip->irq_parent) { + irq_set_chained_handler(gpiochip->irq_parent, NULL); + irq_set_handler_data(gpiochip->irq_parent, NULL); + } + /* Remove all IRQ mappings and delete the domain */ if (gpiochip->irqdomain) { for (offset = 0; offset < gpiochip->ngpio; offset++) |