From 7a8107d95f251b1d1286d6db1e5010ba5c8d40d1 Mon Sep 17 00:00:00 2001 From: Eunseok Choi Date: Tue, 23 May 2017 17:32:35 +0900 Subject: [PATCH] [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 --- drivers/thermal/cpu_cooling.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } /** -- 2.20.1