gpiolib: irqchip: prevent driver unloading if gpio is used as irq only
authorGrygorii Strashko <grygorii.strashko@ti.com>
Thu, 25 Jun 2015 17:30:50 +0000 (20:30 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 16 Jul 2015 11:19:22 +0000 (13:19 +0200)
commit5b76e79c772648991e700f004205e9ac861c77c0
tree9cea395249c47dc8c1ab15abdb753da07dbf422d
parent049aaf9f7e30731ce030eef3e4fd255cf8b1ae02
gpiolib: irqchip: prevent driver unloading if gpio is used as irq only

Now nothing prevents GPIO driver from being unloaded if its gpios
were requested as GPIO IRQs only (without calling gpio_request()).

Hence, add calls of try_module_get()/module_put() into
gpiochip_irq_reqres/relres() to track such scenario properly.

Cc: Johan Hovold <johan@kernel.org>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c