Commit 5e606abe authored by Tony Lindgren's avatar Tony Lindgren Committed by Linus Walleij

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: default avatarSantosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent e799f35c
...@@ -1253,8 +1253,11 @@ static int omap_gpio_probe(struct platform_device *pdev) ...@@ -1253,8 +1253,11 @@ static int omap_gpio_probe(struct platform_device *pdev)
omap_gpio_mod_init(bank); omap_gpio_mod_init(bank);
ret = omap_gpio_chip_init(bank, irqc); ret = omap_gpio_chip_init(bank, irqc);
if (ret) if (ret) {
pm_runtime_put_sync(bank->dev);
pm_runtime_disable(bank->dev);
return ret; return ret;
}
omap_gpio_show_rev(bank); omap_gpio_show_rev(bank);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment