Skip to content

Commit b196622

Browse files
bbkzzvireshk
authored andcommitted
cpufreq: tegra186: 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 4027323 commit b196622

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/cpufreq/tegra186-cpufreq.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,9 @@ static int tegra186_cpufreq_probe(struct platform_device *pdev)
259259
return err;
260260
}
261261

262-
static int tegra186_cpufreq_remove(struct platform_device *pdev)
262+
static void tegra186_cpufreq_remove(struct platform_device *pdev)
263263
{
264264
cpufreq_unregister_driver(&tegra186_cpufreq_driver);
265-
266-
return 0;
267265
}
268266

269267
static const struct of_device_id tegra186_cpufreq_of_match[] = {
@@ -278,7 +276,7 @@ static struct platform_driver tegra186_cpufreq_platform_driver = {
278276
.of_match_table = tegra186_cpufreq_of_match,
279277
},
280278
.probe = tegra186_cpufreq_probe,
281-
.remove = tegra186_cpufreq_remove,
279+
.remove_new = tegra186_cpufreq_remove,
282280
};
283281
module_platform_driver(tegra186_cpufreq_platform_driver);
284282

0 commit comments

Comments
 (0)