[COMMON] thermal: samsung: Use the id property
authorSoomin Kim <sm8326.kim@samsung.com>
Tue, 12 Jul 2016 08:35:25 +0000 (17:35 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:09:29 +0000 (17:09 +0900)
Currently, thermal node number is defined as alias
and the number is generated sequentially. If some
node aren't used the number is not machted with driver.
So, id is defined explicitly.

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

index 8f74f26a2edd4e03aed019b5b1ac0fac8fb3bbb3..214ab07aae3543ef457d74bfc4067359fa99a21b 100644 (file)
@@ -944,9 +944,10 @@ static int exynos_map_dt_data(struct platform_device *pdev)
 
        data->np = pdev->dev.of_node;
 
-       data->id = of_alias_get_id(pdev->dev.of_node, "tmuctrl");
-       if (data->id < 0)
-               data->id = 0;
+       if (of_property_read_u32(pdev->dev.of_node, "id", &data->id)) {
+               dev_err(&pdev->dev, "failed to get TMU ID\n");
+               return -ENODEV;
+       }
 
        data->irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
        if (data->irq <= 0) {