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

cpufreq: pcc-cpufreq: 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>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

authored by

Yangtao Li and committed by
Viresh Kumar
d0988eaa 46ebd4d8

+2 -4
+2 -4
drivers/cpufreq/pcc-cpufreq.c
··· 608 608 return ret; 609 609 } 610 610 611 - static int pcc_cpufreq_remove(struct platform_device *pdev) 611 + static void pcc_cpufreq_remove(struct platform_device *pdev) 612 612 { 613 613 cpufreq_unregister_driver(&pcc_cpufreq_driver); 614 614 615 615 pcc_clear_mapping(); 616 616 617 617 free_percpu(pcc_cpu_info); 618 - 619 - return 0; 620 618 } 621 619 622 620 static struct platform_driver pcc_cpufreq_platdrv = { 623 621 .driver = { 624 622 .name = "pcc-cpufreq", 625 623 }, 626 - .remove = pcc_cpufreq_remove, 624 + .remove_new = pcc_cpufreq_remove, 627 625 }; 628 626 629 627 static int __init pcc_cpufreq_init(void)