The thermal fw support same name for different thermal zones.
If use name to get the thermal zone, sometimes it can't get
the unique thermal zone. And the of-thermal driver is used
to parse DT for thermal fw, so it's better to use device node
to lookup and get thermal zone.

Change-Id: I6c690902a9535915b2f49f9921779fbcd5ecd88c
Signed-off-by: Wei Ni <[email protected]>
---
 drivers/thermal/of-thermal.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
index 53f2d3a..97c12cf 100644
--- a/drivers/thermal/of-thermal.c
+++ b/drivers/thermal/of-thermal.c
@@ -330,7 +330,7 @@ thermal_zone_of_add_sensor(struct device_node *zone,
        struct thermal_zone_device *tzd;
        struct __thermal_zone *tz;
 
-       tzd = thermal_zone_get_zone_by_name(zone->name);
+       tzd = thermal_zone_get_zone_by_node(zone);
        if (IS_ERR(tzd))
                return ERR_PTR(-EPROBE_DEFER);
 
@@ -839,7 +839,7 @@ void of_thermal_destroy_zones(void)
        for_each_child_of_node(np, child) {
                struct thermal_zone_device *zone;
 
-               zone = thermal_zone_get_zone_by_name(child->name);
+               zone = thermal_zone_get_zone_by_node(child);
                if (IS_ERR(zone))
                        continue;
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to