diff options
author | Paul Burton <paul.burton@mips.com> | 2018-08-25 13:53:28 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2018-08-29 07:43:36 -0400 |
commit | 823dd71f58eb2133c24af85fad056a8dbb1a76e9 (patch) | |
tree | e50e67045954a8bb5ade713301a2618011e32f11 | |
parent | b55326dc969ea2d704a008d9a97583b128f54f4f (diff) |
pinctrl: ingenic: Fix group & function error checking
Commit a203728ac6bb ("pinctrl: core: Return selector to the pinctrl
driver") and commit f913cfce4ee4 ("pinctrl: pinmux: Return selector to
the pinctrl driver") modified the return values of
pinctrl_generic_add_group() and pinmux_generic_add_function()
respectively, but did so without updating their callers. This broke the
pinctrl-ingenic driver, which treats non-zero return values from these
functions as errors & fails to probe. For example on a MIPS Ci20:
pinctrl-ingenic 10010000.pin-controller: Failed to register group uart0-hwflow
pinctrl-ingenic: probe of 10010000.pin-controller failed with error 1
Without the pinctrl driver probed, other drivers go on to fail to probe
too & the system is unusable.
Fix this by modifying the error checks to treat only negative values as
errors, matching the commits that introduced the breakage & similar
changes made to other drivers.
Signed-off-by: Paul Burton <paul.burton@mips.com>
Fixes: a203728ac6bb ("pinctrl: core: Return selector to the pinctrl driver")
Fixes: f913cfce4ee4 ("pinctrl: pinmux: Return selector to the pinctrl driver")
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Paul Cercueil <paul@crapouillou.net>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-gpio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/pinctrl/pinctrl-ingenic.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c index 6a1b6058b991..628817c40e3b 100644 --- a/drivers/pinctrl/pinctrl-ingenic.c +++ b/drivers/pinctrl/pinctrl-ingenic.c | |||
@@ -793,7 +793,7 @@ static int ingenic_pinctrl_probe(struct platform_device *pdev) | |||
793 | 793 | ||
794 | err = pinctrl_generic_add_group(jzpc->pctl, group->name, | 794 | err = pinctrl_generic_add_group(jzpc->pctl, group->name, |
795 | group->pins, group->num_pins, group->data); | 795 | group->pins, group->num_pins, group->data); |
796 | if (err) { | 796 | if (err < 0) { |
797 | dev_err(dev, "Failed to register group %s\n", | 797 | dev_err(dev, "Failed to register group %s\n", |
798 | group->name); | 798 | group->name); |
799 | return err; | 799 | return err; |
@@ -806,7 +806,7 @@ static int ingenic_pinctrl_probe(struct platform_device *pdev) | |||
806 | err = pinmux_generic_add_function(jzpc->pctl, func->name, | 806 | err = pinmux_generic_add_function(jzpc->pctl, func->name, |
807 | func->group_names, func->num_group_names, | 807 | func->group_names, func->num_group_names, |
808 | func->data); | 808 | func->data); |
809 | if (err) { | 809 | if (err < 0) { |
810 | dev_err(dev, "Failed to register function %s\n", | 810 | dev_err(dev, "Failed to register function %s\n", |
811 | func->name); | 811 | func->name); |
812 | return err; | 812 | return err; |