spin_lock(&cpufreq_stats_lock);
stat->last_time = get_jiffies_64();
stat->last_index = freq_table_get_index(stat, policy->cur);
+#ifdef CONFIG_ARCH_ROCKCHIP
+ if (stat->last_index == -1)
+ stat->last_index = 0;
+#endif
spin_unlock(&cpufreq_stats_lock);
cpufreq_cpu_put(data);
return 0;
old_index = stat->last_index;
new_index = freq_table_get_index(stat, freq->new);
-#ifdef CONFIG_ARCH_ROCKCHIP
- if (old_index == -1)
- stat->last_index = new_index;
-#endif
/* We can't do stat->time_in_state[-1]= .. */
if (old_index == -1 || new_index == -1)
return 0;