msm: thermal: refactor the code.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>