cpufreq: pcc-cpufreq: Fail initialization if driver cannot be registered
PATCH 1/1 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.
--- drivers/cpufreq/pcc-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cpufreq/pcc-cpufreq.c +2 -2
@@ -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) {
Signature · 1 line
2.18.1
Quoted 18 lines · David Arcari
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]>--- drivers/cpufreq/pcc-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/cpufreq/pcc-cpufreq.c +0
-0@@ -582,10 +582,10 @@ static int __init pcc_cpufreq_init(void)/* Skip initialization if another cpufreq driver is there. */
drivers/cpufreq/pcc-cpufreq.c static int __init pcc_cpufreq_init(void) · line 591
Quoted 10 lines
drivers/cpufreq/pcc-cpufreq.c +2
-2if (cpufreq_get_current_driver ()) -return 0 ; +return -EEXIST ;if (acpi_disabled) -return 0 ; +return -ENODEV ; ret =pcc_cpufreq_probe ();if (ret) {
Signature · 1 line
viresh
Rafael J. Wysocki
AppliedQuoted 23 lines · CEST Viresh Kumar
Quoted 22 lines · David Arcari
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]>--- drivers/cpufreq/pcc-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/cpufreq/pcc-cpufreq.c +1
-1@@ -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 ;
Quoted 8 lines
drivers/cpufreq/pcc-cpufreq.c static int __init pcc_cpufreq_init(void) · line 591
Quoted 6 lines
drivers/cpufreq/pcc-cpufreq.c +1
-1if (acpi_disabled) -return 0 ; +return -ENODEV ; ret =pcc_cpufreq_probe ();if (ret) {Acked-by Viresh Kumar <[email protected]>
Applied, thanks!