Skip to content

Commit eea6c26

Browse files
Uwe Kleine-Königrafaeljw
authored andcommitted
thermal: amlogic: 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(). amlogic_thermal_disable() always returned zero. Change it to return no value and then trivially convert the driver to .remove_new() and fix a whitespace inconsitency en passant. 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 439f0bb commit eea6c26

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/thermal/amlogic_thermal.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,11 @@ static int amlogic_thermal_probe(struct platform_device *pdev)
291291
return ret;
292292
}
293293

294-
static int amlogic_thermal_remove(struct platform_device *pdev)
294+
static void amlogic_thermal_remove(struct platform_device *pdev)
295295
{
296296
struct amlogic_thermal *data = platform_get_drvdata(pdev);
297297

298-
return amlogic_thermal_disable(data);
298+
amlogic_thermal_disable(data);
299299
}
300300

301301
static int __maybe_unused amlogic_thermal_suspend(struct device *dev)
@@ -321,8 +321,8 @@ static struct platform_driver amlogic_thermal_driver = {
321321
.pm = &amlogic_thermal_pm_ops,
322322
.of_match_table = of_amlogic_thermal_match,
323323
},
324-
.probe = amlogic_thermal_probe,
325-
.remove = amlogic_thermal_remove,
324+
.probe = amlogic_thermal_probe,
325+
.remove_new = amlogic_thermal_remove,
326326
};
327327

328328
module_platform_driver(amlogic_thermal_driver);

0 commit comments

Comments
 (0)