Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH] cpufreq: pcc-cpufreq: Fail initialization if driver cannot be registered
@ 2019-06-06 18:50 David Arcari
  2019-06-07  3:05 ` Viresh Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: David Arcari @ 2019-06-06 18:50 UTC (permalink / raw)
  To: linux-pm; +Cc: linux-kernel, David Arcari, Rafael J. Wysocki, Viresh Kumar

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>
---
 drivers/cpufreq/pcc-cpufreq.c | 4 ++--
 1 file 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) {
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-27 22:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-06 18:50 [PATCH] cpufreq: pcc-cpufreq: Fail initialization if driver cannot be registered David Arcari
2019-06-07  3:05 ` Viresh Kumar
2019-06-27 22:00   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox