Skip to content

Commit cc35f43

Browse files
bbkzzvireshk
authored andcommitted
cpufreq: kirkwood: 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 d0988ea commit cc35f43

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/cpufreq/kirkwood-cpufreq.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,20 +178,18 @@ static int kirkwood_cpufreq_probe(struct platform_device *pdev)
178178
return err;
179179
}
180180

181-
static int kirkwood_cpufreq_remove(struct platform_device *pdev)
181+
static void kirkwood_cpufreq_remove(struct platform_device *pdev)
182182
{
183183
cpufreq_unregister_driver(&kirkwood_cpufreq_driver);
184184

185185
clk_disable_unprepare(priv.powersave_clk);
186186
clk_disable_unprepare(priv.ddr_clk);
187187
clk_disable_unprepare(priv.cpu_clk);
188-
189-
return 0;
190188
}
191189

192190
static struct platform_driver kirkwood_cpufreq_platform_driver = {
193191
.probe = kirkwood_cpufreq_probe,
194-
.remove = kirkwood_cpufreq_remove,
192+
.remove_new = kirkwood_cpufreq_remove,
195193
.driver = {
196194
.name = "kirkwood-cpufreq",
197195
},

0 commit comments

Comments
 (0)