cpuidle: Move dev->last_residency update to driver enter routine; remove dev->last_state
[deliverable/linux.git] / arch / arm / mach-kirkwood / cpuidle.c
index f68d33f1f396c5a72b62629e736f3a7265bbc442..358dd80b3a07109e620fcfafd8961a65a89d4c67 100644 (file)
@@ -32,17 +32,17 @@ static DEFINE_PER_CPU(struct cpuidle_device, kirkwood_cpuidle_device);
 
 /* Actual code that puts the SoC in different idle states */
 static int kirkwood_enter_idle(struct cpuidle_device *dev,
-                              struct cpuidle_state *state)
+                              int index)
 {
        struct timeval before, after;
        int idle_time;
 
        local_irq_disable();
        do_gettimeofday(&before);
-       if (state == &dev->states[0])
+       if (index == 0)
                /* Wait for interrupt state */
                cpu_do_idle();
-       else if (state == &dev->states[1]) {
+       else if (index == 1) {
                /*
                 * Following write will put DDR in self refresh.
                 * Note that we have 256 cycles before DDR puts it
@@ -57,7 +57,11 @@ static int kirkwood_enter_idle(struct cpuidle_device *dev,
        local_irq_enable();
        idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
                        (after.tv_usec - before.tv_usec);
-       return idle_time;
+
+       /* Update last residency */
+       dev->last_residency = idle_time;
+
+       return index;
 }
 
 /* Initialize CPU idle by registering the idle states */
This page took 0.024609 seconds and 5 git commands to generate.