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>
This commit is contained in:
parent
b134dc3fea
commit
97fc463769
3 changed files with 5 additions and 4 deletions
|
@ -830,7 +830,8 @@ static int __init u300_gpio_probe(struct platform_device *pdev)
|
|||
return 0;
|
||||
|
||||
err_no_range:
|
||||
err = gpiochip_remove(&gpio->chip);
|
||||
if (gpiochip_remove(&gpio->chip))
|
||||
dev_err(&pdev->dev, "failed to remove gpio chip\n");
|
||||
err_no_chip:
|
||||
err_no_domain:
|
||||
err_no_port:
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -609,8 +609,7 @@ int wmt_pinctrl_probe(struct platform_device *pdev,
|
|||
return 0;
|
||||
|
||||
fail_range:
|
||||
err = gpiochip_remove(&data->gpio_chip);
|
||||
if (err)
|
||||
if (gpiochip_remove(&data->gpio_chip))
|
||||
dev_err(&pdev->dev, "failed to remove gpio chip\n");
|
||||
fail_gpio:
|
||||
pinctrl_unregister(data->pctl_dev);
|
||||
|
|
Loading…
Reference in a new issue