[COMMON] thermal: samsung: Parse thermal zone name
authorSoomin Kim <sm8326.kim@samsung.com>
Tue, 12 Jul 2016 08:01:36 +0000 (17:01 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:09:25 +0000 (17:09 +0900)
If sensor node has tmu_name property, parse the name.

Change-Id: I05df2e9e0a7c9d95ee7219f1c7e7b7fab54ab721
Signed-off-by: Soomin Kim <sm8326.kim@samsung.com>
drivers/thermal/samsung/exynos_tmu.c

index 108571b70d8825ac17dc49dc9208ae1249fb92f2..dac1550875a08b50647f9fc2b6873eed32980680 100644 (file)
@@ -181,6 +181,7 @@ struct exynos_tmu_data {
        int num_of_remotes;
        struct remote_sensor_info *remote_sensors;
        int sensing_mode;
+       char tmu_name[THERMAL_NAME_LENGTH];
 
        int (*tmu_initialize)(struct platform_device *pdev);
        void (*tmu_control)(struct platform_device *pdev, bool on);
@@ -929,7 +930,7 @@ static int exynos_map_dt_data(struct platform_device *pdev)
        struct exynos_tmu_platform_data *pdata;
        struct resource res;
        int i;
-       const char *temp;
+       const char *temp, *tmu_name;
 
        if (!data || !pdev->dev.of_node)
                return -ENODEV;
@@ -970,6 +971,11 @@ static int exynos_map_dt_data(struct platform_device *pdev)
 
        of_property_read_string(pdev->dev.of_node, "sensing_method", &temp);
 
+       if (of_property_read_string(pdev->dev.of_node, "tmu_name", &tmu_name)) {
+               dev_err(&pdev->dev, "failed to get tmu_name\n");
+       } else
+               strncpy(data->tmu_name, tmu_name, THERMAL_NAME_LENGTH);
+
        for (i = 0; i<ARRAY_SIZE(sensing_method); i++)
                if (!strcasecmp(temp, sensing_method[i]))
                        data->sensing_mode = i;