]> git.karo-electronics.de Git - karo-tx-linux.git/commit
thermal: cpu_cooling: Store frequencies in descending order
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 4 Dec 2014 04:12:06 +0000 (09:42 +0530)
committerEduardo Valentin <edubezval@gmail.com>
Mon, 8 Dec 2014 18:11:02 +0000 (14:11 -0400)
commitf6859014c7e7cc0e7688525741fc3a0e7aee63be
treec06b75df0db0d8eb7e0356a9a6147a5d2f4f1a32
parentb9f8b4160310e4459c08b54b918cd83da141f7f0
thermal: cpu_cooling: Store frequencies in descending order

CPUFreq framework *doesn't* guarantee that frequencies present in cpufreq table
will be in ascending or descending order. But cpu_cooling somehow assumes that.

Probably because most of current users are creating this list from DT, which is
done with the help of OPP layer. And OPP layer creates the list in ascending
order of frequencies.

But cpu_cooling can be used for other platforms too, which don't have
frequencies arranged in any order.

This patch tries to fix this issue by creating another list of valid frequencies
in descending order. Care is also taken to throw warnings for duplicate entries.

Later patches would use it to simplify code.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/thermal/cpu_cooling.c