summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/sccnxp.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-11-10 16:29:30 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-11-23 20:12:30 +0100
commit7635d71e6a4bef6751d85bf3014ed135a83fe352 (patch)
tree61c60c247fb10bf3059b40fcd495f8c5cd8e4a91 /drivers/tty/serial/sccnxp.c
parentserial: 8250: omap: Don't skip resource freeing if pm_runtime_resume_and_get(... (diff)
downloadlinux-7635d71e6a4bef6751d85bf3014ed135a83fe352.tar.xz
linux-7635d71e6a4bef6751d85bf3014ed135a83fe352.zip
serial: sccnxp: Improve error message if regulator_disable() fails
Returning an error code from .remove() makes the driver core emit the little helpful error message: remove callback returned a non-zero value. This will be ignored. and then remove the device anyhow. So replace the error return (and with it the little helpful error message) by a more useful error message. Fixes: 31815c08fc90 ("serial: sccnxp: Replace pdata.init/exit with regulator API") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20231110152927.70601-3-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to '')
-rw-r--r--drivers/tty/serial/sccnxp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c
index 2be2c1098025..8269b0fb3083 100644
--- a/drivers/tty/serial/sccnxp.c
+++ b/drivers/tty/serial/sccnxp.c
@@ -1036,8 +1036,11 @@ static int sccnxp_remove(struct platform_device *pdev)
uart_unregister_driver(&s->uart);
- if (!IS_ERR(s->regulator))
- return regulator_disable(s->regulator);
+ if (!IS_ERR(s->regulator)) {
+ int ret = regulator_disable(s->regulator);
+ if (ret)
+ dev_err(&pdev->dev, "Failed to disable regulator\n");
+ }
return 0;
}