thermal: exynos: remove redundant pdata checks from exynos_tmu_initialize()
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Thu, 31 Jul 2014 17:11:01 +0000 (19:11 +0200)
committerEduardo Valentin <edubezval@gmail.com>
Mon, 3 Nov 2014 03:02:47 +0000 (23:02 -0400)
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: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Tested-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/thermal/samsung/exynos_thermal_common.h
drivers/thermal/samsung/exynos_tmu.c

index 3eb2ed9ea3a4db3a9c7811e06a38669cf9b8588e..cd4471925cddbacb95b2c0404625f94264ef3a20 100644 (file)
@@ -27,7 +27,6 @@
 #define SENSOR_NAME_LEN        16
 #define MAX_TRIP_COUNT 8
 #define MAX_COOLING_DEVICE 4
-#define MAX_THRESHOLD_LEVS 5
 
 #define ACTIVE_INTERVAL 500
 #define IDLE_INTERVAL 10000
index 4a55f112cc67df9d4bcf6f1b05b2d1551703f6ec..b9bffad683349b816a43af23d6421b04631a8b8c 100644 (file)
@@ -201,23 +201,10 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
                        (pdata->efuse_value >> reg->triminfo_85_shift) &
                        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++) {
                if (!pdata->trigger_levels[i])
                        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*/
                if (!(pdata->trigger_type[i] == HW_TRIP))
                        trigger_levs++;