serial: uartlite: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20231110152927.70601-51-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7d8ffee1f4
commit
2a0e8be950
|
@ -890,7 +890,7 @@ of_err:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int ulite_remove(struct platform_device *pdev)
|
||||
static void ulite_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct uart_port *port = dev_get_drvdata(&pdev->dev);
|
||||
struct uartlite_data *pdata = port->private_data;
|
||||
|
@ -900,7 +900,6 @@ static int ulite_remove(struct platform_device *pdev)
|
|||
pm_runtime_disable(&pdev->dev);
|
||||
pm_runtime_set_suspended(&pdev->dev);
|
||||
pm_runtime_dont_use_autosuspend(&pdev->dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* work with hotplug and coldplug */
|
||||
|
@ -908,7 +907,7 @@ MODULE_ALIAS("platform:uartlite");
|
|||
|
||||
static struct platform_driver ulite_platform_driver = {
|
||||
.probe = ulite_probe,
|
||||
.remove = ulite_remove,
|
||||
.remove_new = ulite_remove,
|
||||
.driver = {
|
||||
.name = "uartlite",
|
||||
.of_match_table = of_match_ptr(ulite_of_match),
|
||||
|
|
Loading…
Reference in New Issue