Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f23ca1a authored by Linus Walleij's avatar Linus Walleij
Browse files

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: default avatarStephen Warren <swarren@nvidia.com>
Reviewed-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent dfa97515
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1218,10 +1218,11 @@ int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
	pin_range->range.npins = npins;
	pin_range->pctldev = pinctrl_find_and_add_gpio_range(pinctl_name,
			&pin_range->range);
	if (!pin_range->pctldev) {
	if (IS_ERR(pin_range->pctldev)) {
		pr_err("%s: GPIO chip: could not create pin range\n",
		       chip->label);
		kfree(pin_range);
		return PTR_ERR(pin_range->pctldev);
	}
	pr_debug("%s: GPIO chip: created GPIO range %d->%d ==> PIN %d->%d\n",
		 chip->label, offset, offset + npins - 1,