]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: omap: rework omap_gpio_irq_startup to handle current pin state properly
authorGrygorii Strashko <grygorii.strashko@linaro.org>
Fri, 22 May 2015 14:35:52 +0000 (17:35 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 1 Jun 2015 14:53:54 +0000 (16:53 +0200)
commit2b647856a5255f83e58406dadecb6a457b8627a0
tree043416955bff282d15aafd7118a2fc89c718b4fe
parentcfa12e98e5ca994bbc7089cf572e816fcdd9ff09
gpio: omap: rework omap_gpio_irq_startup to handle current pin state properly

The omap_gpio_irq_startup() can be called at time when:
- corresponding GPIO has been requested already and in this case
it has to be configured as input already. If not - return with -EINVAL
and do not try to re-configure it as it could be unsafe.
- corresponding GPIO is free: reconfigure GPIO as input.

In addition, call omap_enable_gpio_module directly as all needed
checks are already present inside it.

Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-omap.c