imx: thermal: imx_get_temp might be called before sensor clock is prepared
authorHeiner Kallweit <heiner.kallweit@web.de>
Sat, 8 Nov 2014 19:35:54 +0000 (20:35 +0100)
committerEduardo Valentin <edubezval@gmail.com>
Sun, 9 Nov 2014 19:42:53 +0000 (15:42 -0400)
imx_get_temp might be called before the sensor clock is prepared
thus resulting in a timeout of the first attempt to read temp:
thermal thermal_zone0: failed to read out thermal zone 0
Happened to me on a Utilite Standard with IMX6 Dual SoC.

Reason is that in imx_thermal_probe thermal_zone_device_register
is called before the sensor clock is prepared.
thermal_zone_device_register however calls
thermal_zone_device_update which eventually calls imx_get_temp.

Fix this by preparing the clock before calling
thermal_zone_device_register.

Signed-off-by: Heiner Kallweit <heiner.kallweit@web.de>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/thermal/imx_thermal.c

Simple merge