thermal: fix cpu_cooling max_level behavior
authorEduardo Valentin <eduardo.valentin@ti.com>
Wed, 13 Nov 2013 18:11:09 +0000 (14:11 -0400)
committerZhang Rui <rui.zhang@intel.com>
Thu, 2 Jan 2014 03:54:14 +0000 (11:54 +0800)
commit1c9573a40c1d34494419f32560f28c763c504d79
treeab8727f4e9452628a579ecea3dc560ebd1110d1c
parent06475b556cb4863cf1dcace9b2d21dac1fc74daf
thermal: fix cpu_cooling max_level behavior

As per Documentation/thermal/sysfs-api.txt, max_level
is an index, not a counter. Thus, in case a CPU has
3 valid frequencies, max_level is expected to be 2, for instance.

The current code makes max_level == number of valid frequencies,
which is bogus. This patch fix the cpu_cooling device by
ranging max_level properly.

Reported-by: Carlos Hernandez <ceh@ti.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
drivers/thermal/cpu_cooling.c