Skip to content

Commit

Permalink
cpufreq: move some initialization stuff to cpufreq_policy_alloc()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
vireshk authored and rafaeljw committed Jan 23, 2015
1 parent ce1bcfe commit 818c571
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,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;

Expand Down Expand Up @@ -1155,9 +1157,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
*/
Expand Down

0 comments on commit 818c571

Please sign in to comment.