]> Git Repo - J-linux.git/commitdiff
cpufreq: pcc-cpufreq: Fail initialization if driver cannot be registered
authorDavid Arcari <[email protected]>
Thu, 6 Jun 2019 18:50:52 +0000 (14:50 -0400)
committerRafael J. Wysocki <[email protected]>
Mon, 17 Jun 2019 10:25:30 +0000 (12:25 +0200)
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 <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Viresh Kumar <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
drivers/cpufreq/pcc-cpufreq.c

index 1e5e64643c3a595d0f5e3ebb4f116ae8a70bc1b4..fdc767fdbe6a8bdc14dfef0b90201ce4b25e1b7a 100644 (file)
@@ -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) {
This page took 0.049147 seconds and 4 git commands to generate.