thermal: devfreq_cooling: Fix perf state when calculate dfc res_util
[sfrench/cifs-2.6.git] / drivers / thermal / devfreq_cooling.c
index 50dec24e967a00deddcb77ecf9709ab22c486d62..8fd7cf1932cd44fd7abdbfed80ffee25f574c842 100644 (file)
@@ -214,7 +214,7 @@ static int devfreq_cooling_get_requested_power(struct thermal_cooling_device *cd
 
                res = dfc->power_ops->get_real_power(df, power, freq, voltage);
                if (!res) {
-                       state = dfc->capped_state;
+                       state = dfc->max_state - dfc->capped_state;
 
                        /* Convert EM power into milli-Watts first */
                        rcu_read_lock();