diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-11-20 08:56:25 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-11-21 02:55:11 -0500 |
commit | 8f23ca1a73a096f21e6618d8e23df613daa5e532 (patch) | |
tree | 3a5395021e8468b50e973a3978b497241b94e7de /drivers/gpio/gpiolib.c | |
parent | dfa9751548444caadda2d6de1a2b67e05b34c2aa (diff) |
gpiolib: return any error code from range creation
If we try to create a range for a certain GPIO chip and the
target pin controller is not yet available it may return
a probe deferral error code, so handle this all the way
our by checking the error code.
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/gpio/gpiolib.c')
-rw-r--r-- | drivers/gpio/gpiolib.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index a59d13d746c5..317ff0440e29 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -1218,10 +1218,11 @@ int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | |||
1218 | pin_range->range.npins = npins; | 1218 | pin_range->range.npins = npins; |
1219 | pin_range->pctldev = pinctrl_find_and_add_gpio_range(pinctl_name, | 1219 | pin_range->pctldev = pinctrl_find_and_add_gpio_range(pinctl_name, |
1220 | &pin_range->range); | 1220 | &pin_range->range); |
1221 | if (!pin_range->pctldev) { | 1221 | if (IS_ERR(pin_range->pctldev)) { |
1222 | pr_err("%s: GPIO chip: could not create pin range\n", | 1222 | pr_err("%s: GPIO chip: could not create pin range\n", |
1223 | chip->label); | 1223 | chip->label); |
1224 | kfree(pin_range); | 1224 | kfree(pin_range); |
1225 | return PTR_ERR(pin_range->pctldev); | ||
1225 | } | 1226 | } |
1226 | pr_debug("%s: GPIO chip: created GPIO range %d->%d ==> PIN %d->%d\n", | 1227 | pr_debug("%s: GPIO chip: created GPIO range %d->%d ==> PIN %d->%d\n", |
1227 | chip->label, offset, offset + npins - 1, | 1228 | chip->label, offset, offset + npins - 1, |