From: David Arcari <darcari@redhat.com>
To: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, David Arcari <darcari@redhat.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Viresh Kumar <viresh.kumar@linaro.org>
Subject: [PATCH] cpufreq: pcc-cpufreq: Fail initialization if driver cannot be registered
Date: Thu, 6 Jun 2019 14:50:52 -0400 [thread overview]
Message-ID: <20190606185052.71959-1-darcari@redhat.com> (raw)
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
next reply other threads:[~2019-06-06 18:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-06 18:50 David Arcari [this message]
2019-06-07 3:05 ` [PATCH] cpufreq: pcc-cpufreq: Fail initialization if driver cannot be registered Viresh Kumar
2019-06-27 22:00 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190606185052.71959-1-darcari@redhat.com \
--to=darcari@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox