public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: "G, Manjunath Kondaiah" <manjugk@ti.com>
To: linux-arm-kernel@lists.infradead.org
Cc: linux-omap@vger.kernel.org, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Grant Likely <grant.likely@secretlab.ca>,
	Greg Kroah-Hartman <greg@kroah.com>, Dilan Lee <dilee@nvidia.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Manjunath GKondaiah <manjunath.gkondaiah@linaro.org>,
	Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH 4/5] gpiolib: handle deferral probe error
Date: Fri, 07 Oct 2011 10:05:26 +0500	[thread overview]
Message-ID: <1317962127-29003-5-git-send-email-manjugk@ti.com> (raw)
In-Reply-To: 1317962127-29003-1-git-send-email-manjugk@ti.com


The gpio library should return -EPROBE_DEFER in gpio_request
if gpio driver is not ready. If drivers pass this error code through to
their caller (which they really should) then this will ensure that the
probe is retried later when further devices become available.

Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
---
Cc: linux-omap@vger.kernel.org
Cc: linux-mmc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Greg Kroah-Hartman <greg@kroah.com>
Cc: Dilan Lee <dilee@nvidia.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Manjunath GKondaiah <manjunath.gkondaiah@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>

 drivers/gpio/gpiolib.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index a971e3d..9081ef8 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1177,13 +1177,15 @@ int gpio_request(unsigned gpio, const char *label)
 {
 	struct gpio_desc	*desc;
 	struct gpio_chip	*chip;
-	int			status = -EINVAL;
+	int			status = -EPROBE_DEFER;
 	unsigned long		flags;
 
 	spin_lock_irqsave(&gpio_lock, flags);
 
-	if (!gpio_is_valid(gpio))
+	if (!gpio_is_valid(gpio)) {
+		status = -EINVAL;
 		goto done;
+	}
 	desc = &gpio_desc[gpio];
 	chip = desc->chip;
 	if (chip == NULL)
-- 
1.7.4.1


  parent reply	other threads:[~2011-10-07  4:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-07  5:05 [PATCH 0/5] Driver Probe Deferral Mechanism G, Manjunath Kondaiah
2011-10-07  5:05 ` [PATCH 1/5] drivercore: add new error value for deferred probe G, Manjunath Kondaiah
2011-10-07  5:05 ` [PATCH 2/5] drivercore: Add driver probe deferral mechanism G, Manjunath Kondaiah
2011-10-07  5:05 ` [PATCH 3/5] regulator: Support driver probe deferral G, Manjunath Kondaiah
2011-10-07  5:05 ` G, Manjunath Kondaiah [this message]
2011-10-07  5:05 ` [PATCH 5/5] omap: hsmmc: use platform_driver_register G, Manjunath Kondaiah
2011-10-07 22:28   ` Grant Likely
  -- strict thread matches above, loose matches on Subject: below --
2011-10-07  5:33 [PATCH 0/5] Driver Probe Deferral Mechanism G, Manjunath Kondaiah
2011-10-07  5:33 ` [PATCH 4/5] gpiolib: handle deferral probe error G, Manjunath Kondaiah
2011-10-07 10:06   ` Alan Cox
2011-10-07 22:09     ` Grant Likely
2011-10-12  6:14       ` G, Manjunath Kondaiah
2011-10-13  4:12         ` Grant Likely

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=1317962127-29003-5-git-send-email-manjugk@ti.com \
    --to=manjugk@ti.com \
    --cc=arnd@arndb.de \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dilee@nvidia.com \
    --cc=grant.likely@secretlab.ca \
    --cc=greg@kroah.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=manjunath.gkondaiah@linaro.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