aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2018-04-26 07:51:18 -0400
committerEduardo Valentin <edubezval@gmail.com>2018-05-06 19:14:33 -0400
commit8f1c404b212baec2f7cb46182a45067066aed131 (patch)
treef8dc8bb1e57988dca7e9142f828250b2f9421b88
parent75e0f100774f84db43a1a14a3b6a8d3375bed321 (diff)
thermal: exynos: always check for critical trip points existence
* Check for critical trip point existence in exynos_tmu_initialize() so it is checked on all SoCs (except Exynos5433 for now). * Use dev_err() instead of pr_err(). * Fix dev_err() to reference "device tree" not "of-thermal.c". * Remove no longer needed check from exynos4412_tmu_initialize(). Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
-rw-r--r--drivers/thermal/samsung/exynos_tmu.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 9e040ebece33..a0c16044d20a 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -331,7 +331,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
331 struct thermal_zone_device *tzd = data->tzd; 331 struct thermal_zone_device *tzd = data->tzd;
332 const struct thermal_trip * const trips = 332 const struct thermal_trip * const trips =
333 of_thermal_get_trip_points(tzd); 333 of_thermal_get_trip_points(tzd);
334 int ret; 334 int ret = 0, temp;
335 335
336 if (!trips) { 336 if (!trips) {
337 dev_err(&pdev->dev, 337 dev_err(&pdev->dev,
@@ -339,6 +339,14 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
339 return -ENODEV; 339 return -ENODEV;
340 } 340 }
341 341
342 if (data->soc != SOC_ARCH_EXYNOS5433) /* FIXME */
343 ret = tzd->ops->get_crit_temp(tzd, &temp);
344 if (ret) {
345 dev_err(&pdev->dev,
346 "No CRITICAL trip point defined in device tree!\n");
347 goto out;
348 }
349
342 if (of_thermal_get_ntrips(tzd) > data->ntrip) { 350 if (of_thermal_get_ntrips(tzd) > data->ntrip) {
343 dev_info(&pdev->dev, 351 dev_info(&pdev->dev,
344 "More trip points than supported by this TMU.\n"); 352 "More trip points than supported by this TMU.\n");
@@ -356,7 +364,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
356 mutex_unlock(&data->lock); 364 mutex_unlock(&data->lock);
357 if (!IS_ERR(data->clk_sec)) 365 if (!IS_ERR(data->clk_sec))
358 clk_disable(data->clk_sec); 366 clk_disable(data->clk_sec);
359 367out:
360 return ret; 368 return ret;
361} 369}
362 370
@@ -480,13 +488,6 @@ static int exynos4412_tmu_initialize(struct platform_device *pdev)
480 } 488 }
481 } 489 }
482 490
483 if (i == of_thermal_get_ntrips(data->tzd)) {
484 pr_err("%s: No CRITICAL trip point defined at of-thermal.c!\n",
485 __func__);
486 ret = -EINVAL;
487 goto out;
488 }
489
490 threshold_code = temp_to_code(data, crit_temp / MCELSIUS); 491 threshold_code = temp_to_code(data, crit_temp / MCELSIUS);
491 /* 1-4 level to be assigned in th0 reg */ 492 /* 1-4 level to be assigned in th0 reg */
492 rising_threshold &= ~(0xff << 8 * i); 493 rising_threshold &= ~(0xff << 8 * i);