Skip to content

Commit 3ebaf0f

Browse files
Uwe Kleine-Königrafaeljw
authored andcommitted
thermal: kirkwood: 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 <[email protected]> Acked-by: Daniel Lezcano <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 3c9e0f2 commit 3ebaf0f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/thermal/kirkwood_thermal.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,21 +90,19 @@ static int kirkwood_thermal_probe(struct platform_device *pdev)
9090
return 0;
9191
}
9292

93-
static int kirkwood_thermal_exit(struct platform_device *pdev)
93+
static void kirkwood_thermal_exit(struct platform_device *pdev)
9494
{
9595
struct thermal_zone_device *kirkwood_thermal =
9696
platform_get_drvdata(pdev);
9797

9898
thermal_zone_device_unregister(kirkwood_thermal);
99-
100-
return 0;
10199
}
102100

103101
MODULE_DEVICE_TABLE(of, kirkwood_thermal_id_table);
104102

105103
static struct platform_driver kirkwood_thermal_driver = {
106104
.probe = kirkwood_thermal_probe,
107-
.remove = kirkwood_thermal_exit,
105+
.remove_new = kirkwood_thermal_exit,
108106
.driver = {
109107
.name = "kirkwood_thermal",
110108
.of_match_table = kirkwood_thermal_id_table,

0 commit comments

Comments
 (0)