Skip to content

Commit 463ff6d

Browse files
bbkzzvireshk
authored andcommitted
cpufreq: davinci: 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 <u.kleine-koenig@pengutronix.de> Signed-off-by: Yangtao Li <frank.li@vivo.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent 8d09c46 commit 463ff6d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/cpufreq/davinci-cpufreq.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,23 +131,21 @@ static int __init davinci_cpufreq_probe(struct platform_device *pdev)
131131
return cpufreq_register_driver(&davinci_driver);
132132
}
133133

134-
static int __exit davinci_cpufreq_remove(struct platform_device *pdev)
134+
static void __exit davinci_cpufreq_remove(struct platform_device *pdev)
135135
{
136136
cpufreq_unregister_driver(&davinci_driver);
137137

138138
clk_put(cpufreq.armclk);
139139

140140
if (cpufreq.asyncclk)
141141
clk_put(cpufreq.asyncclk);
142-
143-
return 0;
144142
}
145143

146144
static struct platform_driver davinci_cpufreq_driver = {
147145
.driver = {
148146
.name = "cpufreq-davinci",
149147
},
150-
.remove = __exit_p(davinci_cpufreq_remove),
148+
.remove_new = __exit_p(davinci_cpufreq_remove),
151149
};
152150

153151
int __init davinci_cpufreq_init(void)

0 commit comments

Comments
 (0)