Skip to content

Commit a8cf928

Browse files
bbkzzvireshk
authored andcommitted
cpufreq: qoriq: 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 1cd04ad commit a8cf928

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/cpufreq/qoriq-cpufreq.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,19 +288,17 @@ static int qoriq_cpufreq_probe(struct platform_device *pdev)
288288
return 0;
289289
}
290290

291-
static int qoriq_cpufreq_remove(struct platform_device *pdev)
291+
static void qoriq_cpufreq_remove(struct platform_device *pdev)
292292
{
293293
cpufreq_unregister_driver(&qoriq_cpufreq_driver);
294-
295-
return 0;
296294
}
297295

298296
static struct platform_driver qoriq_cpufreq_platform_driver = {
299297
.driver = {
300298
.name = "qoriq-cpufreq",
301299
},
302300
.probe = qoriq_cpufreq_probe,
303-
.remove = qoriq_cpufreq_remove,
301+
.remove_new = qoriq_cpufreq_remove,
304302
};
305303
module_platform_driver(qoriq_cpufreq_platform_driver);
306304

0 commit comments

Comments
 (0)