@@ -73,7 +73,7 @@ static struct omap3_idle_statedata omap3_idle_data[] = {
},
};
-struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd;
+static struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd;
static int _cpuidle_allow_idle(struct powerdomain *pwrdm,
struct clockdomain *clkdm)
@@ -252,6 +252,9 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
* its own code.
*/
+ if (!mpu_pd || !core_pd || !per_pd || !cam_pd)
+ return -ENODEV;
+
/*
* Prevent PER off if CORE is not in retention or off as this
* would disable PER wakeups completely.