提交 dfa97515 编写于 作者: L Linus Walleij

pinctrl: make range registration defer properly

This makes the pinctrl_find_and_add_gpio_range() return
-EPROBE_DEFER if the range hosting pin controller cannot be
located. We may assume that the common case for why adding a
range fails is that the targe pin controller device has not
probed yet.
Reviewed-by: NStephen Warren <swarren@nvidia.com>
Reviewed-by: NViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 192c369c
...@@ -350,8 +350,13 @@ struct pinctrl_dev *pinctrl_find_and_add_gpio_range(const char *devname, ...@@ -350,8 +350,13 @@ struct pinctrl_dev *pinctrl_find_and_add_gpio_range(const char *devname,
{ {
struct pinctrl_dev *pctldev = get_pinctrl_dev_from_devname(devname); struct pinctrl_dev *pctldev = get_pinctrl_dev_from_devname(devname);
/*
* If we can't find this device, let's assume that is because
* it has not probed yet, so the driver trying to register this
* range need to defer probing.
*/
if (!pctldev) if (!pctldev)
return NULL; return ERR_PTR(-EPROBE_DEFER);
pinctrl_add_gpio_range(pctldev, range); pinctrl_add_gpio_range(pctldev, range);
return pctldev; return pctldev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册