diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-11-20 08:54:18 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-11-21 02:55:10 -0500 |
commit | dfa9751548444caadda2d6de1a2b67e05b34c2aa (patch) | |
tree | cc34767ee97e0be020dd9fb4d6fb82a26e29768d /drivers/pinctrl | |
parent | 192c369c6165dff233f22aa70209a92b030d233d (diff) |
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: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/core.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 15f5ac864f14..33af811a6a3c 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c | |||
@@ -350,8 +350,13 @@ struct pinctrl_dev *pinctrl_find_and_add_gpio_range(const char *devname, | |||
350 | { | 350 | { |
351 | struct pinctrl_dev *pctldev = get_pinctrl_dev_from_devname(devname); | 351 | struct pinctrl_dev *pctldev = get_pinctrl_dev_from_devname(devname); |
352 | 352 | ||
353 | /* | ||
354 | * If we can't find this device, let's assume that is because | ||
355 | * it has not probed yet, so the driver trying to register this | ||
356 | * range need to defer probing. | ||
357 | */ | ||
353 | if (!pctldev) | 358 | if (!pctldev) |
354 | return NULL; | 359 | return ERR_PTR(-EPROBE_DEFER); |
355 | 360 | ||
356 | pinctrl_add_gpio_range(pctldev, range); | 361 | pinctrl_add_gpio_range(pctldev, range); |
357 | return pctldev; | 362 | return pctldev; |