summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/acpi-cpufreq.c
diff options
context:
space:
mode:
authorPetr Pavlu <petr.pavlu@suse.com>2023-05-11 14:53:12 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-05-15 19:59:29 +0200
commit73c7f8246539da12c76bb731a2fe7389ae55eae8 (patch)
tree543e5fa8476e2140938759abe53d94445c9cd799 /drivers/cpufreq/acpi-cpufreq.c
parentf1fcbaa18b28dec10281551dfe6ed3a3ed80e3d6 (diff)
downloadlinux-stable-73c7f8246539da12c76bb731a2fe7389ae55eae8.tar.gz
linux-stable-73c7f8246539da12c76bb731a2fe7389ae55eae8.tar.bz2
linux-stable-73c7f8246539da12c76bb731a2fe7389ae55eae8.zip
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: 691a63712347 ("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>
Diffstat (limited to 'drivers/cpufreq/acpi-cpufreq.c')
-rw-r--r--drivers/cpufreq/acpi-cpufreq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 29904395e95f..b2f05d27167e 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -975,7 +975,7 @@ static int __init acpi_cpufreq_probe(struct platform_device *pdev)
/* don't keep reloading if cpufreq_driver exists */
if (cpufreq_get_current_driver())
- return -EEXIST;
+ return -ENODEV;
pr_debug("%s\n", __func__);