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

Commit 97fc4637 authored by Axel Lin's avatar Axel Lin Committed by Linus Walleij
Browse files

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: default avatarAxel Lin <axel.lin@ingics.com>
Acked-by: default avatarTony Prisk <linux@prisktech.co.nz>
Acked-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent b134dc3f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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:
+2 −1
Original line number Diff line number Diff line
@@ -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;
+1 −2
Original line number Diff line number Diff line
@@ -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);