powerpc/powernv: 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/20240410124707.194228-2-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f0a816fb12
commit
2193014f79
@ -195,12 +195,11 @@ free_oppanel_data:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int oppanel_remove(struct platform_device *pdev)
|
||||
static void oppanel_remove(struct platform_device *pdev)
|
||||
{
|
||||
misc_deregister(&oppanel_dev);
|
||||
kfree(oppanel_lines);
|
||||
kfree(oppanel_data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id oppanel_match[] = {
|
||||
@ -214,7 +213,7 @@ static struct platform_driver oppanel_driver = {
|
||||
.of_match_table = oppanel_match,
|
||||
},
|
||||
.probe = oppanel_probe,
|
||||
.remove = oppanel_remove,
|
||||
.remove_new = oppanel_remove,
|
||||
};
|
||||
|
||||
module_platform_driver(oppanel_driver);
|
||||
|
Loading…
Reference in New Issue
Block a user