From: Tony Lindgren <tony@atomide.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Alexandre Courbot <gnurou@gmail.com>
Cc: linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Grygorii Strashko <grygorii.strashko@ti.com>,
Javier Martinez Canillas <javier@dowhile0.org>,
Kevin Hilman <khilman@deeprootsystems.com>,
Santosh Shilimkar <ssantosh@kernel.org>
Subject: [PATCH] gpio: omap: Fix gpiochip_add() handling for deferred probe
Date: Fri, 28 Aug 2015 11:44:49 -0700 [thread overview]
Message-ID: <1440787489-15992-1-git-send-email-tony@atomide.com> (raw)
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>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
drivers/gpio/gpio-omap.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index b0c57d5..f09bf0b 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1232,8 +1232,11 @@ static int omap_gpio_probe(struct platform_device *pdev)
omap_gpio_mod_init(bank);
ret = omap_gpio_chip_init(bank, irqc);
- if (ret)
+ if (ret) {
+ pm_runtime_put_sync(bank->dev);
+ pm_runtime_disable(bank->dev);
return ret;
+ }
omap_gpio_show_rev(bank);
--
2.1.4
next reply other threads:[~2015-08-28 18:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-28 18:44 Tony Lindgren [this message]
2015-08-29 17:11 ` [PATCH] gpio: omap: Fix gpiochip_add() handling for deferred probe santosh shilimkar
2015-08-31 9:03 ` Grygorii Strashko
2015-08-31 14:11 ` Tony Lindgren
2015-08-31 14:37 ` Grygorii Strashko
2015-09-08 13:57 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1440787489-15992-1-git-send-email-tony@atomide.com \
--to=tony@atomide.com \
--cc=gnurou@gmail.com \
--cc=grygorii.strashko@ti.com \
--cc=javier@dowhile0.org \
--cc=khilman@deeprootsystems.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=ssantosh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).