diff options
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 0c18ac2fe7c2..9fb2edf36611 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -42,9 +42,8 @@ static struct cpufreq_policy *cpufreq_cpu_data[NR_CPUS]; | |||
42 | static DEFINE_SPINLOCK(cpufreq_driver_lock); | 42 | static DEFINE_SPINLOCK(cpufreq_driver_lock); |
43 | 43 | ||
44 | /* internal prototypes */ | 44 | /* internal prototypes */ |
45 | static int __cpufreq_governor(struct cpufreq_policy *policy, | 45 | static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event); |
46 | unsigned int event); | 46 | static void handle_update(struct work_struct *work); |
47 | static void handle_update(void *data); | ||
48 | 47 | ||
49 | /** | 48 | /** |
50 | * Two notifier lists: the "policy" list is involved in the | 49 | * Two notifier lists: the "policy" list is involved in the |
@@ -61,7 +60,7 @@ static int __init init_cpufreq_transition_notifier_list(void) | |||
61 | srcu_init_notifier_head(&cpufreq_transition_notifier_list); | 60 | srcu_init_notifier_head(&cpufreq_transition_notifier_list); |
62 | return 0; | 61 | return 0; |
63 | } | 62 | } |
64 | core_initcall(init_cpufreq_transition_notifier_list); | 63 | pure_initcall(init_cpufreq_transition_notifier_list); |
65 | 64 | ||
66 | static LIST_HEAD(cpufreq_governor_list); | 65 | static LIST_HEAD(cpufreq_governor_list); |
67 | static DEFINE_MUTEX (cpufreq_governor_mutex); | 66 | static DEFINE_MUTEX (cpufreq_governor_mutex); |
@@ -695,7 +694,7 @@ static int cpufreq_add_dev (struct sys_device * sys_dev) | |||
695 | mutex_init(&policy->lock); | 694 | mutex_init(&policy->lock); |
696 | mutex_lock(&policy->lock); | 695 | mutex_lock(&policy->lock); |
697 | init_completion(&policy->kobj_unregister); | 696 | init_completion(&policy->kobj_unregister); |
698 | INIT_WORK(&policy->update, handle_update, (void *)(long)cpu); | 697 | INIT_WORK(&policy->update, handle_update); |
699 | 698 | ||
700 | /* call driver. From then on the cpufreq must be able | 699 | /* call driver. From then on the cpufreq must be able |
701 | * to accept all calls to ->verify and ->setpolicy for this CPU | 700 | * to accept all calls to ->verify and ->setpolicy for this CPU |
@@ -925,9 +924,11 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev) | |||
925 | } | 924 | } |
926 | 925 | ||
927 | 926 | ||
928 | static void handle_update(void *data) | 927 | static void handle_update(struct work_struct *work) |
929 | { | 928 | { |
930 | unsigned int cpu = (unsigned int)(long)data; | 929 | struct cpufreq_policy *policy = |
930 | container_of(work, struct cpufreq_policy, update); | ||
931 | unsigned int cpu = policy->cpu; | ||
931 | dprintk("handle_update for cpu %u called\n", cpu); | 932 | dprintk("handle_update for cpu %u called\n", cpu); |
932 | cpufreq_update_policy(cpu); | 933 | cpufreq_update_policy(cpu); |
933 | } | 934 | } |
@@ -1599,7 +1600,6 @@ int cpufreq_update_policy(unsigned int cpu) | |||
1599 | } | 1600 | } |
1600 | EXPORT_SYMBOL(cpufreq_update_policy); | 1601 | EXPORT_SYMBOL(cpufreq_update_policy); |
1601 | 1602 | ||
1602 | #ifdef CONFIG_HOTPLUG_CPU | ||
1603 | static int cpufreq_cpu_callback(struct notifier_block *nfb, | 1603 | static int cpufreq_cpu_callback(struct notifier_block *nfb, |
1604 | unsigned long action, void *hcpu) | 1604 | unsigned long action, void *hcpu) |
1605 | { | 1605 | { |
@@ -1639,7 +1639,6 @@ static struct notifier_block __cpuinitdata cpufreq_cpu_notifier = | |||
1639 | { | 1639 | { |
1640 | .notifier_call = cpufreq_cpu_callback, | 1640 | .notifier_call = cpufreq_cpu_callback, |
1641 | }; | 1641 | }; |
1642 | #endif /* CONFIG_HOTPLUG_CPU */ | ||
1643 | 1642 | ||
1644 | /********************************************************************* | 1643 | /********************************************************************* |
1645 | * REGISTER / UNREGISTER CPUFREQ DRIVER * | 1644 | * REGISTER / UNREGISTER CPUFREQ DRIVER * |