From: Viresh Kumar <viresh.kumar@linaro.org>
To: Rafael Wysocki <rjw@rjwysocki.net>
Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org,
prarit@redhat.com, skannan@codeaurora.org,
Viresh Kumar <viresh.kumar@linaro.org>
Subject: [PATCH 17/17] cpufreq: move some initialization stuff to cpufreq_policy_alloc()
Date: Fri, 2 Jan 2015 12:34:38 +0530 [thread overview]
Message-ID: <a00aab63c7b296546fbd59ed8670a97eec0c4ec7.1420181916.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1420181916.git.viresh.kumar@linaro.org>
In-Reply-To: <cover.1420181916.git.viresh.kumar@linaro.org>
We need to initialize completion and work only on policy allocation and not
really on the policy restore side and so we better move this piece of code to
cpufreq_policy_alloc().
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/cpufreq/cpufreq.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 62c6a0b8b0d1..ace5dd4cd271 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1019,6 +1019,8 @@ static struct cpufreq_policy *cpufreq_policy_alloc(void)
init_rwsem(&policy->rwsem);
spin_lock_init(&policy->transition_lock);
init_waitqueue_head(&policy->transition_wait);
+ init_completion(&policy->kobj_unregister);
+ INIT_WORK(&policy->update, handle_update);
return policy;
@@ -1142,9 +1144,6 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif)
cpumask_copy(policy->cpus, cpumask_of(cpu));
- init_completion(&policy->kobj_unregister);
- INIT_WORK(&policy->update, handle_update);
-
/* call driver. From then on the cpufreq must be able
* to accept all calls to ->verify and ->setpolicy for this CPU
*/
--
2.2.0
next prev parent reply other threads:[~2015-01-02 7:06 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-02 7:04 [PATCH 00/17] cpufreq: trivial cleanups Viresh Kumar
2015-01-02 7:04 ` [PATCH 01/17] cpufreq: remove dangling comment Viresh Kumar
2015-01-02 7:04 ` [PATCH 02/17] cpufreq: remove extra parenthesis Viresh Kumar
2015-01-02 7:04 ` [PATCH 03/17] cpufreq: don't need line break in show_scaling_cur_freq() Viresh Kumar
2015-01-02 7:04 ` [PATCH 04/17] cpufreq: merge 'if' blocks in __cpufreq_remove_dev_prepare() Viresh Kumar
2015-01-02 7:04 ` [PATCH 05/17] cpufreq: s/__find_governor/find_governor Viresh Kumar
2015-01-02 7:04 ` [PATCH 06/17] cpufreq: No need to check for has_target() Viresh Kumar
2015-01-02 7:04 ` [PATCH 07/17] cpufreq: pass policy to cpufreq_out_of_sync Viresh Kumar
2015-01-02 7:04 ` [PATCH 08/17] cpufreq: pass policy to __cpufreq_get() Viresh Kumar
2015-01-02 7:04 ` [PATCH 09/17] cpufreq: update driver_data->flags only if we are registering driver Viresh Kumar
2015-01-02 7:04 ` [PATCH 10/17] cpufreq: get rid of CONFIG_{HOTPLUG_CPU|SMP} mess Viresh Kumar
2015-01-02 7:04 ` [PATCH 11/17] cpufreq: get rid of 'tpolicy' from __cpufreq_add_dev() Viresh Kumar
2015-01-02 7:04 ` [PATCH 12/17] cpufreq: use light-weight cpufreq_cpu_get_raw() in __cpufreq_add_dev Viresh Kumar
2015-01-02 7:04 ` [PATCH 13/17] cpufreq: limit the scope of l_p_j variables Viresh Kumar
2015-01-02 7:04 ` [PATCH 14/17] cpufreq: check cpufreq_policy_list instead of scanning policies for all CPUs Viresh Kumar
2015-01-02 7:04 ` [PATCH 15/17] cpufreq: don't check if cpu > nr_cpu_ids Viresh Kumar
2015-01-02 7:04 ` [PATCH 16/17] cpufreq: remove check for cpufreq_disabled() from cpufreq_cpu_{get|put}() Viresh Kumar
2015-01-25 13:24 ` Viresh Kumar
2015-01-26 0:39 ` Rafael J. Wysocki
2015-01-27 3:47 ` Viresh Kumar
2015-01-02 7:04 ` Viresh Kumar [this message]
2015-01-12 6:11 ` [PATCH 00/17] cpufreq: trivial cleanups Viresh Kumar
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=a00aab63c7b296546fbd59ed8670a97eec0c4ec7.1420181916.git.viresh.kumar@linaro.org \
--to=viresh.kumar@linaro.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-pm@vger.kernel.org \
--cc=prarit@redhat.com \
--cc=rjw@rjwysocki.net \
--cc=skannan@codeaurora.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).