All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] driver: base: pinctrl: return error from pinctrl_bind_pins()
@ 2016-09-13  7:13 ` Deepak
  0 siblings, 0 replies; 6+ messages in thread
From: Deepak @ 2016-09-13  7:13 UTC (permalink / raw)
  To: linus.walleij; +Cc: linux-kernel, linux-gpio, vzapolsk

strict pin controller returns -EINVAL in case of pin request which
is already claimed by somebody else.
Following is the sequence of calling pin_request() from
pinctrl_bind_pins():-
pinctrl_bind_pins()->pinctrl_select_state()->pinmux_enable_setting()->
pin_request()

But pinctrl_bind_pins() only returns -EPROBE_DEFER which makes device
driver probe successful even if the pin request is rejected by the pin
controller subsystem.

This commit modifies pinctrl_bind_pins() to return error if the pin is
rejected by pin control subsystem.

Signed-off-by: Deepak Das <deepak_das@mentor.com>
---
  drivers/base/pinctrl.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/pinctrl.c b/drivers/base/pinctrl.c
index 0762975..e65c1af 100644
--- a/drivers/base/pinctrl.c
+++ b/drivers/base/pinctrl.c
@@ -92,7 +92,7 @@ cleanup_alloc:
      dev->pins = NULL;

      /* Only return deferrals */
-    if (ret != -EPROBE_DEFER)
+    if ((ret != -EPROBE_DEFER) && (ret != -EINVAL))
          ret = 0;

      return ret;
-- 
1.9.1


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

end of thread, other threads:[~2016-09-14  6:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-13  7:13 [PATCH] driver: base: pinctrl: return error from pinctrl_bind_pins() Deepak
2016-09-13  7:13 ` Deepak
2016-09-13 11:59 ` Linus Walleij
2016-09-13 13:41   ` Deepak Das
2016-09-13 21:01     ` Linus Walleij
2016-09-14  6:22       ` Deepak Das

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.