From: Thierry Reding <treding@xxxxxxxxxx> Store the device tree node for each thermal zone device to allow it to be referenced. Signed-off-by: Thierry Reding <treding@xxxxxxxxxx> --- Changes in v2: - new patch to track thermal zone device tree nodes drivers/thermal/thermal_of.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index db83596ea105..2acb65e97090 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -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", -- 2.42.0