driver: base: pinctrl: return error from, pinctrl_bind_pins()
Subsystems (2)
PATCH v2 1/1 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.
---
Changes from v1 to v2:
* Modified the comment to indicate return error in case of invalid pin requests
drivers/base/pinctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/base/pinctrl.c +2 -2
@@ -80,8 +80,8 @@ cleanup_alloc:devm_kfree (dev, dev->pins); dev->pins =NULL ; -/* Only return deferrals */ -if (ret != -EPROBE_DEFER ) +/* Return deferrals & invalid pin requests */ +if ((ret != -EPROBE_DEFER ) && (ret != -EINVAL )) ret =0 ;return ret;
--
1.9.1
Quoted 3 lines · Deepak Das
Changes from v1 to v2:
* Modified the comment to indicate return error in case of invalid pin requests
I already applied something similar, the semantics should be the same. (Your patch, just edited around with it.)
Yours,
Linus Walleij