When none of cpus are online in policy,
do not need to calculate the power
Change-Id: If7e0fb21c804260bc0cb3df71a03ee09db235261
Signed-off-by: Hyeonseong Gil <hs.gil@samsung.com>
*power = 0;
dev = get_cpu_device(policy->cpu);
- WARN_ON(!dev);
+
+ if (!dev)
+ return 0;
opp = dev_pm_opp_find_freq_exact(dev, freq_hz, true);
if (IS_ERR(opp)) {
cpu = cpumask_any_and(policy->related_cpus, cpu_online_mask);
+ /* None of our cpus are online */
+ if (cpu >= nr_cpu_ids)
+ return -ENODEV;
+
cur_freq = cpufreq_quick_get(policy->cpu);
ret = get_static_power(cpufreq_cdev, tz, cur_freq, &static_power);
if (ret)