Skip to content

Commit 439f0bb

Browse files
Uwe Kleine-Königrafaeljw
authored andcommitted
thermal: uniphier: 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 f3e38da commit 439f0bb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/thermal/uniphier_thermal.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,14 +317,12 @@ static int uniphier_tm_probe(struct platform_device *pdev)
317317
return 0;
318318
}
319319

320-
static int uniphier_tm_remove(struct platform_device *pdev)
320+
static void uniphier_tm_remove(struct platform_device *pdev)
321321
{
322322
struct uniphier_tm_dev *tdev = platform_get_drvdata(pdev);
323323

324324
/* disable sensor */
325325
uniphier_tm_disable_sensor(tdev);
326-
327-
return 0;
328326
}
329327

330328
static const struct uniphier_tm_soc_data uniphier_pxs2_tm_data = {
@@ -362,7 +360,7 @@ MODULE_DEVICE_TABLE(of, uniphier_tm_dt_ids);
362360

363361
static struct platform_driver uniphier_tm_driver = {
364362
.probe = uniphier_tm_probe,
365-
.remove = uniphier_tm_remove,
363+
.remove_new = uniphier_tm_remove,
366364
.driver = {
367365
.name = "uniphier-thermal",
368366
.of_match_table = uniphier_tm_dt_ids,

0 commit comments

Comments
 (0)