diff options
author | David Arcari <darcari@redhat.com> | 2019-06-06 14:50:52 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2019-06-17 12:25:30 +0200 |
commit | 2d4a79ae34048996906e585375c2e3e699e1e11a (patch) | |
tree | 6124e81d3adbe1ed4e5c15f7ee701676b15dedeb /drivers/cpufreq/pcc-cpufreq.c | |
parent | 9e0babf2c06c73cda2c0cd37a1653d823adb40ec (diff) | |
download | lwn-2d4a79ae34048996906e585375c2e3e699e1e11a.tar.gz lwn-2d4a79ae34048996906e585375c2e3e699e1e11a.zip |
cpufreq: pcc-cpufreq: Fail initialization if driver cannot be registered
Make pcc_cpufreq_init() return error codes when the driver cannot be
registered. Otherwise the driver can shows up loaded via lsmod even
though it failed initialization. This is confusing to the user.
Signed-off-by: David Arcari <darcari@redhat.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/pcc-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/pcc-cpufreq.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cpufreq/pcc-cpufreq.c b/drivers/cpufreq/pcc-cpufreq.c index 1e5e64643c3a..fdc767fdbe6a 100644 --- a/drivers/cpufreq/pcc-cpufreq.c +++ b/drivers/cpufreq/pcc-cpufreq.c @@ -582,10 +582,10 @@ static int __init pcc_cpufreq_init(void) /* Skip initialization if another cpufreq driver is there. */ if (cpufreq_get_current_driver()) - return 0; + return -EEXIST; if (acpi_disabled) - return 0; + return -ENODEV; ret = pcc_cpufreq_probe(); if (ret) { |