From: Eunseok Choi Date: Tue, 23 May 2017 08:32:35 +0000 (+0900) Subject: [COMMON] thermal: cpu_cooling: discard invalid cooling level X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7a8107d95f251b1d1286d6db1e5010ba5c8d40d1;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] thermal: cpu_cooling: discard invalid cooling level Resolved migration conflicts from kernel 4.9 to 4.14. - freq_table and power_table are merged into struct freq_table Change-Id: If039d12292d1901b08444e162b23ca08bdbb8427 Signed-off-by: Eunseok Choi --- diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index 59ac5c3f10ab..f285b37ca7b2 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -581,8 +581,12 @@ static int exynos_cpufreq_cooling_get_level(struct thermal_cooling_device *cdev, unsigned long value) { struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata; + int level = get_level(cpufreq_cdev, value); - return get_level(cpufreq_cdev, value); + if (level == THERMAL_CSTATE_INVALID && value > cpufreq_cdev->freq_table[0].frequency) + level = 0; + + return level; } /**