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>
This commit is contained in:
David Arcari 2019-06-06 14:50:52 -04:00 committed by Rafael J. Wysocki
parent 9e0babf2c0
commit 2d4a79ae34

View File

@ -582,10 +582,10 @@ static int __init pcc_cpufreq_init(void)
/* 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 0; return -EEXIST;
if (acpi_disabled) if (acpi_disabled)
return 0; return -ENODEV;
ret = pcc_cpufreq_probe(); ret = pcc_cpufreq_probe();
if (ret) { if (ret) {