summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/pinctrl-stmfx.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-10-09 11:38:37 +0300
committerLinus Walleij <linus.walleij@linaro.org>2023-10-10 16:34:52 +0300
commit35df4b75bd57e0699d0a1ff696880dcbd7e565f2 (patch)
tree9ac4d007d2851b1b2d756ad12d4b77b63b1c1f29 /drivers/pinctrl/pinctrl-stmfx.c
parentb1191940909a482d4d82f5b2e449e04829c0d739 (diff)
downloadlinux-35df4b75bd57e0699d0a1ff696880dcbd7e565f2.tar.xz
pinctrl: stmfx: Improve error message in .remove()'s error path
The driver core has no handling for errors returned by the .remove() callback. The only action on error is a dev_warn() with generic error message that the returned value is returned. Replace it by a more specific and useful message. Then returning zero is the right thing to do, the only effect is to suppress the core's warning. This prepares the driver for the conversion to .remove_new(). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20231009083856.222030-2-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-stmfx.c')
-rw-r--r--drivers/pinctrl/pinctrl-stmfx.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
index 0974bbf57b54..d7ab82432a52 100644
--- a/drivers/pinctrl/pinctrl-stmfx.c
+++ b/drivers/pinctrl/pinctrl-stmfx.c
@@ -737,11 +737,17 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev)
static int stmfx_pinctrl_remove(struct platform_device *pdev)
{
struct stmfx *stmfx = dev_get_drvdata(pdev->dev.parent);
+ int ret;
+
+ ret = stmfx_function_disable(stmfx,
+ STMFX_FUNC_GPIO |
+ STMFX_FUNC_ALTGPIO_LOW |
+ STMFX_FUNC_ALTGPIO_HIGH);
+ if (ret)
+ dev_err(&pdev->dev, "Failed to disable pins (%pe)\n",
+ ERR_PTR(ret));
- return stmfx_function_disable(stmfx,
- STMFX_FUNC_GPIO |
- STMFX_FUNC_ALTGPIO_LOW |
- STMFX_FUNC_ALTGPIO_HIGH);
+ return 0;
}
#ifdef CONFIG_PM_SLEEP