Commit 930aa102 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Eduardo Valentin

thermal: exynos: remove redundant pdata checks from exynos_tmu_initialize()

Remove runtime checks for pdata sanity from exynos_tmu_initialize().

The current values hardcoded in pdata will never trigger the checks
and checking itself is not proper.  The checks in question are done
at runtime in a production code for data that is hardcoded inside
driver during development time and later it doesn't change.  Such
data should be verified during development and review time (i.e. by
a script parsing relevant data from exynos_tmu_data.c, one can also
argue that verification to be done is so simple that the review by
a maintainer should be enough).

There should be no functional changes caused by this patch.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Tested-by: default avatarAmit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
parent d37761ec
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#define SENSOR_NAME_LEN 16 #define SENSOR_NAME_LEN 16
#define MAX_TRIP_COUNT 8 #define MAX_TRIP_COUNT 8
#define MAX_COOLING_DEVICE 4 #define MAX_COOLING_DEVICE 4
#define MAX_THRESHOLD_LEVS 5
#define ACTIVE_INTERVAL 500 #define ACTIVE_INTERVAL 500
#define IDLE_INTERVAL 10000 #define IDLE_INTERVAL 10000
......
...@@ -201,23 +201,10 @@ static int exynos_tmu_initialize(struct platform_device *pdev) ...@@ -201,23 +201,10 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
(pdata->efuse_value >> reg->triminfo_85_shift) & (pdata->efuse_value >> reg->triminfo_85_shift) &
EXYNOS_TMU_TEMP_MASK; EXYNOS_TMU_TEMP_MASK;
if (pdata->max_trigger_level > MAX_THRESHOLD_LEVS) {
dev_err(&pdev->dev, "Invalid max trigger level\n");
ret = -EINVAL;
goto out;
}
for (i = 0; i < pdata->max_trigger_level; i++) { for (i = 0; i < pdata->max_trigger_level; i++) {
if (!pdata->trigger_levels[i]) if (!pdata->trigger_levels[i])
continue; continue;
if ((pdata->trigger_type[i] == HW_TRIP) &&
(!pdata->trigger_levels[pdata->max_trigger_level - 1])) {
dev_err(&pdev->dev, "Invalid hw trigger level\n");
ret = -EINVAL;
goto out;
}
/* Count trigger levels except the HW trip*/ /* Count trigger levels except the HW trip*/
if (!(pdata->trigger_type[i] == HW_TRIP)) if (!(pdata->trigger_type[i] == HW_TRIP))
trigger_levs++; trigger_levs++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment