diff options
author | Deepak <deepak_das@mentor.com> | 2016-09-13 10:13:04 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-09-14 00:02:59 +0300 |
commit | eb4ec68acf5ebb312d29840287e465d3d414b07e (patch) | |
tree | c0040544a574ca3a2567d8ae4de0cfbbc53b23d4 /drivers/base/pinctrl.c | |
parent | 9b5fb0ca5d512fc28369484a4d03d376d0b17e39 (diff) | |
download | linux-eb4ec68acf5ebb312d29840287e465d3d414b07e.tar.xz |
driver: base: pinctrl: return error from pinctrl_bind_pins()
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>
[Rewrote to be cleaner]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/base/pinctrl.c')
-rw-r--r-- | drivers/base/pinctrl.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/base/pinctrl.c b/drivers/base/pinctrl.c index 076297592754..5917b4b5fb99 100644 --- a/drivers/base/pinctrl.c +++ b/drivers/base/pinctrl.c @@ -91,9 +91,13 @@ cleanup_alloc: devm_kfree(dev, dev->pins); dev->pins = NULL; - /* Only return deferrals */ - if (ret != -EPROBE_DEFER) - ret = 0; + /* Return deferrals */ + if (ret == -EPROBE_DEFER) + return ret; + /* Return serious errors */ + if (ret == -EINVAL) + return ret; + /* We ignore errors like -ENOENT meaning no pinctrl state */ - return ret; + return 0; } |