aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-05-19 01:58:37 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-05-27 09:37:08 -0400
commit97fc463769f1564e8eda2e2f70d3b6e92a25ff16 (patch)
treef1ee749b141b7055f9995afa506c83539bc6382e /drivers/pinctrl
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')
-rw-r--r--drivers/pinctrl/pinctrl-coh901.c3
-rw-r--r--drivers/pinctrl/pinctrl-sunxi.c3
-rw-r--r--drivers/pinctrl/vt8500/pinctrl-wmt.c3
3 files changed, 5 insertions, 4 deletions
diff --git a/drivers/pinctrl/pinctrl-coh901.c b/drivers/pinctrl/pinctrl-coh901.c
index a67af419f531..d6b41747d687 100644
--- a/drivers/pinctrl/pinctrl-coh901.c
+++ b/drivers/pinctrl/pinctrl-coh901.c
@@ -830,7 +830,8 @@ static int __init u300_gpio_probe(struct platform_device *pdev)
830 return 0; 830 return 0;
831 831
832err_no_range: 832err_no_range:
833 err = gpiochip_remove(&gpio->chip); 833 if (gpiochip_remove(&gpio->chip))
834 dev_err(&pdev->dev, "failed to remove gpio chip\n");
834err_no_chip: 835err_no_chip:
835err_no_domain: 836err_no_domain:
836err_no_port: 837err_no_port:
diff --git a/drivers/pinctrl/pinctrl-sunxi.c b/drivers/pinctrl/pinctrl-sunxi.c
index c52fc2c08732..c058529db8f6 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)
2000 return 0; 2000 return 0;
2001 2001
2002gpiochip_error: 2002gpiochip_error:
2003 ret = gpiochip_remove(pctl->chip); 2003 if (gpiochip_remove(pctl->chip))
2004 dev_err(&pdev->dev, "failed to remove gpio chip\n");
2004pinctrl_error: 2005pinctrl_error:
2005 pinctrl_unregister(pctl->pctl_dev); 2006 pinctrl_unregister(pctl->pctl_dev);
2006 return ret; 2007 return ret;
diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c b/drivers/pinctrl/vt8500/pinctrl-wmt.c
index ab63104e8dc9..70d986e04afb 100644
--- a/drivers/pinctrl/vt8500/pinctrl-wmt.c
+++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c
@@ -609,8 +609,7 @@ int wmt_pinctrl_probe(struct platform_device *pdev,
609 return 0; 609 return 0;
610 610
611fail_range: 611fail_range:
612 err = gpiochip_remove(&data->gpio_chip); 612 if (gpiochip_remove(&data->gpio_chip))
613 if (err)
614 dev_err(&pdev->dev, "failed to remove gpio chip\n"); 613 dev_err(&pdev->dev, "failed to remove gpio chip\n");
615fail_gpio: 614fail_gpio:
616 pinctrl_unregister(data->pctl_dev); 615 pinctrl_unregister(data->pctl_dev);