提交 73c7f824 编写于 作者: P Petr Pavlu 提交者: Rafael J. Wysocki

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: 691a6371 ("ACPI: cpufreq: Use platform devices to load ACPI PPC and PCC drivers")
Reported-by: NKevin Locke <kevin@kevinlocke.name>
Link: https://lore.kernel.org/lkml/ZFreh8SDMX67EaB6@kevinlocke.name/Signed-off-by: NPetr Pavlu <petr.pavlu@suse.com>
Tested-by: NKevin Locke <kevin@kevinlocke.name>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 f1fcbaa1
...@@ -975,7 +975,7 @@ static int __init acpi_cpufreq_probe(struct platform_device *pdev) ...@@ -975,7 +975,7 @@ static int __init acpi_cpufreq_probe(struct platform_device *pdev)
/* don't keep reloading if cpufreq_driver exists */ /* don't keep reloading if cpufreq_driver exists */
if (cpufreq_get_current_driver()) if (cpufreq_get_current_driver())
return -EEXIST; return -ENODEV;
pr_debug("%s\n", __func__); pr_debug("%s\n", __func__);
......
...@@ -583,7 +583,7 @@ static int __init pcc_cpufreq_probe(struct platform_device *pdev) ...@@ -583,7 +583,7 @@ static int __init pcc_cpufreq_probe(struct platform_device *pdev)
/* Skip initialization if another cpufreq driver is there. */ /* Skip initialization if another cpufreq driver is there. */
if (cpufreq_get_current_driver()) if (cpufreq_get_current_driver())
return -EEXIST; return -ENODEV;
if (acpi_disabled) if (acpi_disabled)
return -ENODEV; return -ENODEV;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册