@@ -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;
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(-)