Skip to content

Commit 24bbbfb

Browse files
Uwe Kleine-Königrafaeljw
authored andcommitted
thermal: rzg2l: 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 cc86ac4 commit 24bbbfb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/thermal/rzg2l_thermal.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,12 @@ static void rzg2l_thermal_reset_assert_pm_disable_put(struct platform_device *pd
150150
reset_control_assert(priv->rstc);
151151
}
152152

153-
static int rzg2l_thermal_remove(struct platform_device *pdev)
153+
static void rzg2l_thermal_remove(struct platform_device *pdev)
154154
{
155155
struct rzg2l_thermal_priv *priv = dev_get_drvdata(&pdev->dev);
156156

157157
thermal_remove_hwmon_sysfs(priv->zone);
158158
rzg2l_thermal_reset_assert_pm_disable_put(pdev);
159-
160-
return 0;
161159
}
162160

163161
static int rzg2l_thermal_probe(struct platform_device *pdev)
@@ -242,7 +240,7 @@ static struct platform_driver rzg2l_thermal_driver = {
242240
.of_match_table = rzg2l_thermal_dt_ids,
243241
},
244242
.probe = rzg2l_thermal_probe,
245-
.remove = rzg2l_thermal_remove,
243+
.remove_new = rzg2l_thermal_remove,
246244
};
247245
module_platform_driver(rzg2l_thermal_driver);
248246

0 commit comments

Comments
 (0)