Skip to content

Commit

Permalink
pinctrl: make range registration defer properly
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Linus Walleij committed Nov 21, 2012
1 parent 192c369 commit dfa9751
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/pinctrl/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*
* 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)
return NULL;
return ERR_PTR(-EPROBE_DEFER);

pinctrl_add_gpio_range(pctldev, range);
return pctldev;
Expand Down

0 comments on commit dfa9751

Please sign in to comment.