Skip to content

Commit 73c7f82

Browse files
petrpavlurafaeljw
authored andcommitted
cpufreq: ACPI: Prevent a warning when another frequency driver is loaded
The recent change to use platform devices to load ACPI PPC and PCC drivers caused that a misleading warning is reported when a respective module cannot be loaded because another CPU frequency driver is already registered: kernel: acpi-cpufreq: probe of acpi-cpufreq failed with error -17 Address it by changing the return code in acpi-cpufreq and pcc-cpufreq for this case from -EEXIST to -ENODEV which silences the warning in call_driver_probe(). The change has also a benefit for users of init_module() as this return code is propagated out from the syscall. The previous -EEXIST code made the callers, such as kmod, wrongly believe that the module was already loaded instead of that it failed to load. Fixes: 691a637 ("ACPI: cpufreq: Use platform devices to load ACPI PPC and PCC drivers") Reported-by: Kevin Locke <kevin@kevinlocke.name> Link: https://lore.kernel.org/lkml/ZFreh8SDMX67EaB6@kevinlocke.name/ Signed-off-by: Petr Pavlu <petr.pavlu@suse.com> Tested-by: Kevin Locke <kevin@kevinlocke.name> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent f1fcbaa commit 73c7f82

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/cpufreq/acpi-cpufreq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ static int __init acpi_cpufreq_probe(struct platform_device *pdev)
975975

976976
/* don't keep reloading if cpufreq_driver exists */
977977
if (cpufreq_get_current_driver())
978-
return -EEXIST;
978+
return -ENODEV;
979979

980980
pr_debug("%s\n", __func__);
981981

drivers/cpufreq/pcc-cpufreq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ static int __init pcc_cpufreq_probe(struct platform_device *pdev)
583583

584584
/* Skip initialization if another cpufreq driver is there. */
585585
if (cpufreq_get_current_driver())
586-
return -EEXIST;
586+
return -ENODEV;
587587

588588
if (acpi_disabled)
589589
return -ENODEV;

0 commit comments

Comments
 (0)