Skip to content

Commit 7c2714a

Browse files
Uwe Kleine-Königrafaeljw
authored andcommitted
thermal: spear: 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 0b478d7 commit 7c2714a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/thermal/spear_thermal.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static int spear_thermal_probe(struct platform_device *pdev)
150150
return ret;
151151
}
152152

153-
static int spear_thermal_exit(struct platform_device *pdev)
153+
static void spear_thermal_exit(struct platform_device *pdev)
154154
{
155155
unsigned int actual_mask = 0;
156156
struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev);
@@ -163,8 +163,6 @@ static int spear_thermal_exit(struct platform_device *pdev)
163163
writel_relaxed(actual_mask & ~stdev->flags, stdev->thermal_base);
164164

165165
clk_disable(stdev->clk);
166-
167-
return 0;
168166
}
169167

170168
static const struct of_device_id spear_thermal_id_table[] = {
@@ -175,7 +173,7 @@ MODULE_DEVICE_TABLE(of, spear_thermal_id_table);
175173

176174
static struct platform_driver spear_thermal_driver = {
177175
.probe = spear_thermal_probe,
178-
.remove = spear_thermal_exit,
176+
.remove_new = spear_thermal_exit,
179177
.driver = {
180178
.name = "spear_thermal",
181179
.pm = &spear_thermal_pm_ops,

0 commit comments

Comments
 (0)