Skip to content

Commit 4027323

Browse files
bbkzzvireshk
authored andcommitted
cpufreq: qcom-nvmem: 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 cc35f43 commit 4027323

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/cpufreq/qcom-cpufreq-nvmem.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ static int qcom_cpufreq_probe(struct platform_device *pdev)
333333
return ret;
334334
}
335335

336-
static int qcom_cpufreq_remove(struct platform_device *pdev)
336+
static void qcom_cpufreq_remove(struct platform_device *pdev)
337337
{
338338
struct qcom_cpufreq_drv *drv = platform_get_drvdata(pdev);
339339
unsigned int cpu;
@@ -345,13 +345,11 @@ static int qcom_cpufreq_remove(struct platform_device *pdev)
345345

346346
kfree(drv->opp_tokens);
347347
kfree(drv);
348-
349-
return 0;
350348
}
351349

352350
static struct platform_driver qcom_cpufreq_driver = {
353351
.probe = qcom_cpufreq_probe,
354-
.remove = qcom_cpufreq_remove,
352+
.remove_new = qcom_cpufreq_remove,
355353
.driver = {
356354
.name = "qcom-cpufreq-nvmem",
357355
},

0 commit comments

Comments
 (0)