From bc841ce96f17ea6d366e71cc96d8a162aa4614d5 Mon Sep 17 00:00:00 2001 From: Roland Stigge Date: Thu, 28 Jun 2012 00:32:14 +0200 Subject: [PATCH] gpio: of_get_named_gpio_flags() return -EPROBE_DEFER if GPIO not yet available of_get_named_gpio_flags() and of_get_named_gpio() return -EPROBE_DEFER if the respective GPIO is not (yet) available. This is useful if driver's probe() functions try to get a GPIO whose controller isn't probed yet. Thus, the driver can be probed again later on. The function still returns -EINVAL on other errors (parse error or node doesn't exist). This way, the case of an optional/intentionally missing GPIO is handled appropriately. Change-Id: Icf8026b9af2192a287d8609df1054ad4d1a14658 Signed-off-by: Roland Stigge Acked-by: Alexandre Pereira da Silva Signed-off-by: Linus Walleij [stepanm@codeaurora.org: backported to 3.4] Signed-off-by: Stepan Moskovchenko --- drivers/of/gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/of/gpio.c b/drivers/of/gpio.c index bf984b6dc47..94e76d821df 100644 --- a/drivers/of/gpio.c +++ b/drivers/of/gpio.c @@ -49,7 +49,7 @@ int of_get_named_gpio_flags(struct device_node *np, const char *propname, if (!gc) { pr_debug("%s: gpio controller %s isn't registered\n", np->full_name, gpiospec.np->full_name); - ret = -ENODEV; + ret = -EPROBE_DEFER; goto err1; }