linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Arcari <darcari@redhat.com>
To: linux-acpi@vger.kernel.org
Cc: David Arcari <darcari@redhat.com>,
	Viresh Kumar <viresh.kumar@linaro.org>
Subject: [PATCH] cpufreq: cpufreq_register_driver should return -ENODEV if init fails
Date: Fri, 26 May 2017 11:37:31 -0400	[thread overview]
Message-ID: <1495813051-146077-1-git-send-email-darcari@redhat.com> (raw)

For a driver that does not set the CPUFREQ_STICKY flag, if all of the
->init() calls fail, cpufreq_register_driver() should return an error.
This will prevent the driver from loading.

Fixes: ce1bcfe94db8 ("cpufreq: check cpufreq_policy_list instead of scanning policies for all CPUs")

Cc: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: David Arcari <darcari@redhat.com>
---
 drivers/cpufreq/cpufreq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 0e3f649..26b643d 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2468,6 +2468,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
 	if (!(cpufreq_driver->flags & CPUFREQ_STICKY) &&
 	    list_empty(&cpufreq_policy_list)) {
 		/* if all ->init() calls failed, unregister */
+		ret = -ENODEV;
 		pr_debug("%s: No CPU initialized for driver %s\n", __func__,
 			 driver_data->name);
 		goto err_if_unreg;
-- 
1.8.3.1


             reply	other threads:[~2017-05-26 15:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-26 15:37 David Arcari [this message]
2017-05-29  4:32 ` [PATCH] cpufreq: cpufreq_register_driver should return -ENODEV if init fails Viresh Kumar
2017-05-30 12:05   ` David Arcari
2017-05-30 21:42     ` 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=1495813051-146077-1-git-send-email-darcari@redhat.com \
    --to=darcari@redhat.com \
    --cc=linux-acpi@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).