aboutsummaryrefslogtreecommitdiff
path: root/drivers/pinctrl/pinctrl-sunxi.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-05-19 13:58:37 +0800
committerLinus Walleij <linus.walleij@linaro.org>2013-05-27 15:37:08 +0200
commit97fc463769f1564e8eda2e2f70d3b6e92a25ff16 (patch)
treef1ee749b141b7055f9995afa506c83539bc6382e /drivers/pinctrl/pinctrl-sunxi.c
parentb134dc3feaa5136b376c7d2658bbe156bea19e63 (diff)
pinctrl: Don't override the error code in probe error handling
Otherwise, we return 0 in probe error paths when gpiochip_remove() returns 0. Also show error message if gpiochip_remove() fails. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Tony Prisk <linux@prisktech.co.nz> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-sunxi.c')
-rw-r--r--drivers/pinctrl/pinctrl-sunxi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-sunxi.c b/drivers/pinctrl/pinctrl-sunxi.c
index c52fc2c0873..c058529db8f 100644
--- a/drivers/pinctrl/pinctrl-sunxi.c
+++ b/drivers/pinctrl/pinctrl-sunxi.c
@@ -2000,7 +2000,8 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev)
return 0;
gpiochip_error:
- ret = gpiochip_remove(pctl->chip);
+ if (gpiochip_remove(pctl->chip))
+ dev_err(&pdev->dev, "failed to remove gpio chip\n");
pinctrl_error:
pinctrl_unregister(pctl->pctl_dev);
return ret;