aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell/cpufreq_spudemand.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/cell/cpufreq_spudemand.c')
-rw-r--r--arch/powerpc/platforms/cell/cpufreq_spudemand.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/arch/powerpc/platforms/cell/cpufreq_spudemand.c b/arch/powerpc/platforms/cell/cpufreq_spudemand.c
index 968c1c0b4d5..d809836bcf5 100644
--- a/arch/powerpc/platforms/cell/cpufreq_spudemand.c
+++ b/arch/powerpc/platforms/cell/cpufreq_spudemand.c
@@ -39,8 +39,6 @@ struct spu_gov_info_struct {
39}; 39};
40static DEFINE_PER_CPU(struct spu_gov_info_struct, spu_gov_info); 40static DEFINE_PER_CPU(struct spu_gov_info_struct, spu_gov_info);
41 41
42static struct workqueue_struct *kspugov_wq;
43
44static int calc_freq(struct spu_gov_info_struct *info) 42static int calc_freq(struct spu_gov_info_struct *info)
45{ 43{
46 int cpu; 44 int cpu;
@@ -71,14 +69,14 @@ static void spu_gov_work(struct work_struct *work)
71 __cpufreq_driver_target(info->policy, target_freq, CPUFREQ_RELATION_H); 69 __cpufreq_driver_target(info->policy, target_freq, CPUFREQ_RELATION_H);
72 70
73 delay = usecs_to_jiffies(info->poll_int); 71 delay = usecs_to_jiffies(info->poll_int);
74 queue_delayed_work_on(info->policy->cpu, kspugov_wq, &info->work, delay); 72 schedule_delayed_work_on(info->policy->cpu, &info->work, delay);
75} 73}
76 74
77static void spu_gov_init_work(struct spu_gov_info_struct *info) 75static void spu_gov_init_work(struct spu_gov_info_struct *info)
78{ 76{
79 int delay = usecs_to_jiffies(info->poll_int); 77 int delay = usecs_to_jiffies(info->poll_int);
80 INIT_DELAYED_WORK_DEFERRABLE(&info->work, spu_gov_work); 78 INIT_DELAYED_WORK_DEFERRABLE(&info->work, spu_gov_work);
81 queue_delayed_work_on(info->policy->cpu, kspugov_wq, &info->work, delay); 79 schedule_delayed_work_on(info->policy->cpu, &info->work, delay);
82} 80}
83 81
84static void spu_gov_cancel_work(struct spu_gov_info_struct *info) 82static void spu_gov_cancel_work(struct spu_gov_info_struct *info)
@@ -152,27 +150,15 @@ static int __init spu_gov_init(void)
152{ 150{
153 int ret; 151 int ret;
154 152
155 kspugov_wq = create_workqueue("kspugov");
156 if (!kspugov_wq) {
157 printk(KERN_ERR "creation of kspugov failed\n");
158 ret = -EFAULT;
159 goto out;
160 }
161
162 ret = cpufreq_register_governor(&spu_governor); 153 ret = cpufreq_register_governor(&spu_governor);
163 if (ret) { 154 if (ret)
164 printk(KERN_ERR "registration of governor failed\n"); 155 printk(KERN_ERR "registration of governor failed\n");
165 destroy_workqueue(kspugov_wq);
166 goto out;
167 }
168out:
169 return ret; 156 return ret;
170} 157}
171 158
172static void __exit spu_gov_exit(void) 159static void __exit spu_gov_exit(void)
173{ 160{
174 cpufreq_unregister_governor(&spu_governor); 161 cpufreq_unregister_governor(&spu_governor);
175 destroy_workqueue(kspugov_wq);
176} 162}
177 163
178 164