diff mbox

[v2,2/2] thermal: use device node to get thermal zone

Message ID 1389263879-10483-3-git-send-email-wni@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Zhang Rui
Headers show

Commit Message

Wei Ni Jan. 9, 2014, 10:37 a.m. UTC
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 <wni@nvidia.com>
---
 drivers/thermal/of-thermal.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

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;