summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJassi Brar <jaswinder.singh@linaro.org>2011-12-12 16:59:07 +0800
committerAndy Green <andy.green@linaro.org>2012-02-09 05:54:32 +0800
commit19620e413659cb96353cf3381626ece5e829132c (patch)
tree0316c0b0d3c3053278541fd16c6654a6602f50b5
parent27bbf8fe3945b03d8d6dc2b0d9b99abf96edf38d (diff)
OMAP4: Fix cpuidle statestracking-topic-pm
The cpuidle driver needs to specify number of states/modes that it can switch between. Also move the driver registration to after all the data structures have been initialized. Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
-rw-r--r--arch/arm/mach-omap2/cpuidle44xx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
index cfdbb86bc84..09824da0758 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -198,7 +198,6 @@ int __init omap4_idle_init(void)
if ((!mpu_pd) || (!cpu0_pd) || (!cpu1_pd))
return -ENODEV;
-
drv->safe_state_index = -1;
dev = &per_cpu(omap4_idle_dev, cpu_id);
dev->cpu = cpu_id;
@@ -227,13 +226,14 @@ int __init omap4_idle_init(void)
cx->mpu_logic_state = PWRDM_POWER_OFF;
drv->state_count = OMAP4_NUM_STATES;
+ dev->state_count = OMAP4_NUM_STATES;
+
cpuidle_register_driver(&omap4_idle_driver);
- dev->state_count = OMAP4_NUM_STATES;
if (cpuidle_register_device(dev)) {
pr_err("%s: CPUidle register device failed\n", __func__);
return -EIO;
- }
+ }
return 0;
}