mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-19 01:36:13 +07:00
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>
This commit is contained in:
parent
9b5fb0ca5d
commit
eb4ec68acf
@ -91,9 +91,13 @@ int pinctrl_bind_pins(struct device *dev)
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user