ARM: OMAP3: cpuidle - check the powerdomain lookup
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Fri, 4 May 2012 17:18:40 +0000 (19:18 +0200)
committerKevin Hilman <khilman@ti.com>
Fri, 4 May 2012 21:07:10 +0000 (14:07 -0700)
At init time, check the powerdomains lookup is successful otherwise
exit the cpuidle driver init function with -ENODEV like what is done for the
omap3 cpuidle driver.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Jean Pihet <j-pihet@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
arch/arm/mach-omap2/cpuidle34xx.c

index f682e170325a15c5a0b698a661a62f3d53c30701..207bc1c7759f1bb66b986d0ff1dbadd8c2b01925 100644 (file)
@@ -363,6 +363,9 @@ int __init omap3_idle_init(void)
        per_pd = pwrdm_lookup("per_pwrdm");
        cam_pd = pwrdm_lookup("cam_pwrdm");
 
+       if (!mpu_pd || !core_pd || !per_pd || !cam_pd)
+               return -ENODEV;
+
        cpuidle_register_driver(&omap3_idle_driver);
 
        dev = &per_cpu(omap3_idle_dev, smp_processor_id());