Skip to content

Commit 1cd04ad

Browse files
bbkzzvireshk
authored andcommitted
cpufreq: acpi: 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]> Acked-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
1 parent b196622 commit 1cd04ad

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/cpufreq/acpi-cpufreq.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,22 +1011,20 @@ static int __init acpi_cpufreq_probe(struct platform_device *pdev)
10111011
return ret;
10121012
}
10131013

1014-
static int acpi_cpufreq_remove(struct platform_device *pdev)
1014+
static void acpi_cpufreq_remove(struct platform_device *pdev)
10151015
{
10161016
pr_debug("%s\n", __func__);
10171017

10181018
cpufreq_unregister_driver(&acpi_cpufreq_driver);
10191019

10201020
free_acpi_perf_data();
1021-
1022-
return 0;
10231021
}
10241022

10251023
static struct platform_driver acpi_cpufreq_platdrv = {
10261024
.driver = {
10271025
.name = "acpi-cpufreq",
10281026
},
1029-
.remove = acpi_cpufreq_remove,
1027+
.remove_new = acpi_cpufreq_remove,
10301028
};
10311029

10321030
static int __init acpi_cpufreq_init(void)

0 commit comments

Comments
 (0)