Skip to content

Commit f1afede

Browse files
Uwe Kleine-Königrafaeljw
authored andcommitted
thermal: soctherm: 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 ca92bde commit f1afede

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/thermal/tegra/soctherm.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2219,15 +2219,13 @@ static int tegra_soctherm_probe(struct platform_device *pdev)
22192219
return err;
22202220
}
22212221

2222-
static int tegra_soctherm_remove(struct platform_device *pdev)
2222+
static void tegra_soctherm_remove(struct platform_device *pdev)
22232223
{
22242224
struct tegra_soctherm *tegra = platform_get_drvdata(pdev);
22252225

22262226
debugfs_remove_recursive(tegra->debugfs_dir);
22272227

22282228
soctherm_clk_enable(pdev, false);
2229-
2230-
return 0;
22312229
}
22322230

22332231
static int __maybe_unused soctherm_suspend(struct device *dev)
@@ -2274,7 +2272,7 @@ static SIMPLE_DEV_PM_OPS(tegra_soctherm_pm, soctherm_suspend, soctherm_resume);
22742272

22752273
static struct platform_driver tegra_soctherm_driver = {
22762274
.probe = tegra_soctherm_probe,
2277-
.remove = tegra_soctherm_remove,
2275+
.remove_new = tegra_soctherm_remove,
22782276
.driver = {
22792277
.name = "tegra_soctherm",
22802278
.pm = &tegra_soctherm_pm,

0 commit comments

Comments
 (0)