Skip to content

Commit 35df4b7

Browse files
Uwe Kleine-KönigLinus Walleij
authored andcommitted
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>
1 parent b119194 commit 35df4b7

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

drivers/pinctrl/pinctrl-stmfx.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -737,11 +737,17 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev)
737737
static int stmfx_pinctrl_remove(struct platform_device *pdev)
738738
{
739739
struct stmfx *stmfx = dev_get_drvdata(pdev->dev.parent);
740+
int ret;
741+
742+
ret = stmfx_function_disable(stmfx,
743+
STMFX_FUNC_GPIO |
744+
STMFX_FUNC_ALTGPIO_LOW |
745+
STMFX_FUNC_ALTGPIO_HIGH);
746+
if (ret)
747+
dev_err(&pdev->dev, "Failed to disable pins (%pe)\n",
748+
ERR_PTR(ret));
740749

741-
return stmfx_function_disable(stmfx,
742-
STMFX_FUNC_GPIO |
743-
STMFX_FUNC_ALTGPIO_LOW |
744-
STMFX_FUNC_ALTGPIO_HIGH);
750+
return 0;
745751
}
746752

747753
#ifdef CONFIG_PM_SLEEP

0 commit comments

Comments
 (0)