@@ -443,6 +443,7 @@ static void thermal_of_zone_unregister(struct thermal_zone_device *tz)
struct thermal_zone_device_ops *ops = tz->ops;
thermal_zone_device_disable(tz);
+ of_node_put(tz->device.of_node);
thermal_zone_device_unregister(tz);
kfree(trips);
kfree(ops);
@@ -521,6 +522,8 @@ static struct thermal_zone_device *thermal_of_zone_register(struct device_node *
goto out_kfree_trips;
}
+ tz->device.of_node = np;
+
ret = thermal_zone_device_enable(tz);
if (ret) {
pr_err("Failed to enabled thermal zone '%s', id=%d: %d\n",