Skip to content

Commit a07f448

Browse files
Uwe Kleine-Königrafaeljw
authored andcommitted
thermal: rcar_gen3: 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]> Reviewed-by: Wolfram Sang <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 2128ba4 commit a07f448

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/thermal/rcar_gen3_thermal.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,14 +432,12 @@ static const struct of_device_id rcar_gen3_thermal_dt_ids[] = {
432432
};
433433
MODULE_DEVICE_TABLE(of, rcar_gen3_thermal_dt_ids);
434434

435-
static int rcar_gen3_thermal_remove(struct platform_device *pdev)
435+
static void rcar_gen3_thermal_remove(struct platform_device *pdev)
436436
{
437437
struct device *dev = &pdev->dev;
438438

439439
pm_runtime_put(dev);
440440
pm_runtime_disable(dev);
441-
442-
return 0;
443441
}
444442

445443
static void rcar_gen3_hwmon_action(void *data)
@@ -594,7 +592,7 @@ static struct platform_driver rcar_gen3_thermal_driver = {
594592
.of_match_table = rcar_gen3_thermal_dt_ids,
595593
},
596594
.probe = rcar_gen3_thermal_probe,
597-
.remove = rcar_gen3_thermal_remove,
595+
.remove_new = rcar_gen3_thermal_remove,
598596
};
599597
module_platform_driver(rcar_gen3_thermal_driver);
600598

0 commit comments

Comments
 (0)