All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpiolib: Defer failed gpio requests by default
@ 2012-05-02 11:49 Mark Brown
  2012-05-18  4:32 ` Grant Likely
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2012-05-02 11:49 UTC (permalink / raw)
  To: Grant Likely, Linus Walleij; +Cc: linux-kernel, Mark Brown

Since users must be explicitly provided with a GPIO number in order to
request one the overwhelmingly common case for failing to request will
be that the required GPIO driver has not yet registered and we should
therefore defer until it has registered.

In order to avoid having to code this logic in individual drivers have
gpio_request() return -EPROBE_DEFER when failing to look up the GPIO.
Drivers which don't want this behaviour can override it if they desire.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/gpio/gpiolib.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 566d012..b244b0c 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1186,7 +1186,7 @@ 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);
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH] gpiolib: Defer failed gpio requests by default
@ 2012-07-09 11:22 Mark Brown
  2012-07-09 20:31 ` Linus Walleij
  2012-07-17 18:20 ` Linus Walleij
  0 siblings, 2 replies; 9+ messages in thread
From: Mark Brown @ 2012-07-09 11:22 UTC (permalink / raw)
  To: Linus Walleij, Grant Likely; +Cc: linux-kernel, Mark Brown

Since users must be explicitly provided with a GPIO number in order to
request one the overwhelmingly common case for failing to request will
be that the required GPIO driver has not yet registered and we should
therefore defer until it has registered.

In order to avoid having to code this logic in individual drivers have
gpio_request() return -EPROBE_DEFER when failing to look up the GPIO.
Drivers which don't want this behaviour can override it if they desire.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/gpio/gpiolib.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 120b2a0..de0213c 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1186,7 +1186,7 @@ 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);
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-07-17 18:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-02 11:49 [PATCH] gpiolib: Defer failed gpio requests by default Mark Brown
2012-05-18  4:32 ` Grant Likely
2012-05-18  8:45   ` Mark Brown
2012-05-18 16:35   ` Alan Stern
2012-07-09 11:22 Mark Brown
2012-07-09 20:31 ` Linus Walleij
2012-07-09 21:54   ` Grant Likely
2012-07-10 11:07     ` Mark Brown
2012-07-17 18:20 ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.