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: 31815c08fc ("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>
This commit is contained in:
Uwe Kleine-König 2023-11-10 16:29:30 +01:00 committed by Greg Kroah-Hartman
parent ad90d0358b
commit 7635d71e6a
1 changed files with 5 additions and 2 deletions

View File

@ -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;
}