Skip to content

Commit fd45940

Browse files
bbkzzvireshk
authored andcommitted
cpufreq: omap: 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 (mostly) ignored 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. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Cc: Uwe Kleine-König <[email protected]> Signed-off-by: Yangtao Li <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
1 parent a8cf928 commit fd45940

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/cpufreq/omap-cpufreq.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,19 +182,17 @@ static int omap_cpufreq_probe(struct platform_device *pdev)
182182
return cpufreq_register_driver(&omap_driver);
183183
}
184184

185-
static int omap_cpufreq_remove(struct platform_device *pdev)
185+
static void omap_cpufreq_remove(struct platform_device *pdev)
186186
{
187187
cpufreq_unregister_driver(&omap_driver);
188-
189-
return 0;
190188
}
191189

192190
static struct platform_driver omap_cpufreq_platdrv = {
193191
.driver = {
194192
.name = "omap-cpufreq",
195193
},
196194
.probe = omap_cpufreq_probe,
197-
.remove = omap_cpufreq_remove,
195+
.remove_new = omap_cpufreq_remove,
198196
};
199197
module_platform_driver(omap_cpufreq_platdrv);
200198

0 commit comments

Comments
 (0)