Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

authored by

Yangtao Li and committed by
Viresh Kumar
cc35f433 d0988eaa

+2 -4
+2 -4
drivers/cpufreq/kirkwood-cpufreq.c
··· 178 178 return err; 179 179 } 180 180 181 - static int kirkwood_cpufreq_remove(struct platform_device *pdev) 181 + static void kirkwood_cpufreq_remove(struct platform_device *pdev) 182 182 { 183 183 cpufreq_unregister_driver(&kirkwood_cpufreq_driver); 184 184 185 185 clk_disable_unprepare(priv.powersave_clk); 186 186 clk_disable_unprepare(priv.ddr_clk); 187 187 clk_disable_unprepare(priv.cpu_clk); 188 - 189 - return 0; 190 188 } 191 189 192 190 static struct platform_driver kirkwood_cpufreq_platform_driver = { 193 191 .probe = kirkwood_cpufreq_probe, 194 - .remove = kirkwood_cpufreq_remove, 192 + .remove_new = kirkwood_cpufreq_remove, 195 193 .driver = { 196 194 .name = "kirkwood-cpufreq", 197 195 },