From 022b11f0db60fc1e2e6e373817b50b0257466b39 Mon Sep 17 00:00:00 2001 From: Hyeonseong Gil Date: Wed, 30 Mar 2016 16:52:16 +0900 Subject: [PATCH] thermal: move THERMAL_DEVICE_ENABLED THERMAL_DEVICE_ENABLED was set during thermal_zone_of_sensor_register(). it cause incorrect temperature reading before tmu initialize. So, move it after tmu h/w control. Change-Id: Ic7fe67ff6a29db87a34f8c189ae2c79014befc5f Signed-off-by: Hyeonseong Gil --- drivers/thermal/of-thermal.c | 2 -- drivers/thermal/samsung/exynos_tmu.c | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c index 6c33f9c09d6a..1fb527a169c3 100644 --- a/drivers/thermal/of-thermal.c +++ b/drivers/thermal/of-thermal.c @@ -510,8 +510,6 @@ thermal_zone_of_sensor_register(struct device *dev, int sensor_id, void *data, if (sensor_specs.np == sensor_np && id == sensor_id) { tzd = thermal_zone_of_add_sensor(child, sensor_np, data, ops); - if (!IS_ERR(tzd)) - tzd->ops->set_mode(tzd, THERMAL_DEVICE_ENABLED); of_node_put(sensor_specs.np); of_node_put(child); diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index d1daf3196221..4da916c80e55 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -724,6 +724,10 @@ static int exynos_tmu_probe(struct platform_device *pdev) } exynos_tmu_control(pdev, true); + + if (!IS_ERR(data->tzd)) + data->tzd->ops->set_mode(data->tzd, THERMAL_DEVICE_ENABLED); + return 0; err_thermal: -- 2.20.1