aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/rack-meter.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh/rack-meter.c')
-rw-r--r--drivers/macintosh/rack-meter.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c
index f1b6f563673a..5ed41fe84e57 100644
--- a/drivers/macintosh/rack-meter.c
+++ b/drivers/macintosh/rack-meter.c
@@ -48,7 +48,8 @@ struct rackmeter_dma {
48} ____cacheline_aligned; 48} ____cacheline_aligned;
49 49
50struct rackmeter_cpu { 50struct rackmeter_cpu {
51 struct work_struct sniffer; 51 struct delayed_work sniffer;
52 struct rackmeter *rm;
52 cputime64_t prev_wall; 53 cputime64_t prev_wall;
53 cputime64_t prev_idle; 54 cputime64_t prev_idle;
54 int zero; 55 int zero;
@@ -208,11 +209,12 @@ static void rackmeter_setup_dbdma(struct rackmeter *rm)
208 rackmeter_do_pause(rm, 0); 209 rackmeter_do_pause(rm, 0);
209} 210}
210 211
211static void rackmeter_do_timer(void *data) 212static void rackmeter_do_timer(struct work_struct *work)
212{ 213{
213 struct rackmeter *rm = data; 214 struct rackmeter_cpu *rcpu =
215 container_of(work, struct rackmeter_cpu, sniffer.work);
216 struct rackmeter *rm = rcpu->rm;
214 unsigned int cpu = smp_processor_id(); 217 unsigned int cpu = smp_processor_id();
215 struct rackmeter_cpu *rcpu = &rm->cpu[cpu];
216 cputime64_t cur_jiffies, total_idle_ticks; 218 cputime64_t cur_jiffies, total_idle_ticks;
217 unsigned int total_ticks, idle_ticks; 219 unsigned int total_ticks, idle_ticks;
218 int i, offset, load, cumm, pause; 220 int i, offset, load, cumm, pause;
@@ -263,8 +265,10 @@ static void __devinit rackmeter_init_cpu_sniffer(struct rackmeter *rm)
263 * on those machines yet 265 * on those machines yet
264 */ 266 */
265 267
266 INIT_WORK(&rm->cpu[0].sniffer, rackmeter_do_timer, rm); 268 rm->cpu[0].rm = rm;
267 INIT_WORK(&rm->cpu[1].sniffer, rackmeter_do_timer, rm); 269 INIT_DELAYED_WORK(&rm->cpu[0].sniffer, rackmeter_do_timer);
270 rm->cpu[1].rm = rm;
271 INIT_DELAYED_WORK(&rm->cpu[1].sniffer, rackmeter_do_timer);
268 272
269 for_each_online_cpu(cpu) { 273 for_each_online_cpu(cpu) {
270 struct rackmeter_cpu *rcpu; 274 struct rackmeter_cpu *rcpu;