gpio: omap: Fix gpiochip_add() handling for deferred probe
authorTony Lindgren <tony@atomide.com>
Fri, 28 Aug 2015 18:44:49 +0000 (11:44 -0700)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 14 Sep 2015 07:12:03 +0000 (09:12 +0200)
commit5e606abef57a89b3ca25f5d97a953c6cdad7cbac
tree0eb22797c53b6a639f4a345d8c7fd6007eec028a
parente799f35c32ea940222b568abf38d6abcab7fa8c1
gpio: omap: Fix gpiochip_add() handling for deferred probe

Currently we gpio-omap breaks if gpiochip_add() returns -EPROBE_DEFER:

[    0.570000] gpiochip_add: GPIOs 0..31 (gpio) failed to register
[    0.570000] omap_gpio 48310000.gpio: Could not register gpio chip -517
...
[    3.670000] omap_gpio 48310000.gpio: Unbalanced pm_runtime_enable!

Let's fix the issue by adding the missing pm_runtime_put() on error.

Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Javier Martinez Canillas <javier@dowhile0.org>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-omap.c