aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzk@kernel.org>2018-05-13 13:54:02 -0400
committerEduardo Valentin <edubezval@gmail.com>2018-06-01 17:32:01 -0400
commitffe6e16f14faf5af6bae7293ebddb481a1d77ae6 (patch)
tree90bf3d3a25b281f70b1089cce8aea4212ce1c9f1
parent45f8b0dde3c4e5445aebeb950de1dffacd94d4a6 (diff)
thermal: exynos: Reduce severity of too early temperature read
Thermal core tries to read temperature during sensor registering in thermal_zone_of_sensor_register(). In that time Exynos TMU driver and hardware are not yet initialized. Commit 0eb875d88aaa ("thermal: exynos: Reading temperature makes sense only when TMU is turned on") added a boolean flag to prevent reading bogus temperature in such case but it exposed warning message during boot: [ 3.864913] thermal thermal_zone0: failed to read out thermal zone (-22) Return EAGAIN in such case to skip omitting such message because it might mislead user. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
-rw-r--r--drivers/thermal/samsung/exynos_tmu.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 3b20309789e3..c24969d740d1 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -666,8 +666,14 @@ static int exynos_get_temp(void *p, int *temp)
666 struct exynos_tmu_data *data = p; 666 struct exynos_tmu_data *data = p;
667 int value, ret = 0; 667 int value, ret = 0;
668 668
669 if (!data || !data->tmu_read || !data->enabled) 669 if (!data || !data->tmu_read)
670 return -EINVAL; 670 return -EINVAL;
671 else if (!data->enabled)
672 /*
673 * Called too early, probably
674 * from thermal_zone_of_sensor_register().
675 */
676 return -EAGAIN;
671 677
672 mutex_lock(&data->lock); 678 mutex_lock(&data->lock);
673 clk_enable(data->clk); 679 clk_enable(data->clk);