Skip to contentSkip to conversation

thermal/core: associate device tree node to thermal_cooling_device::device

PATCH New Jianeng Chen 1 participant 1 message Feb 6, 2023 Thermal

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal/core: associate device tree node to thermal_cooling_device::device

When adding a gpio property to a cooling device node in device tree, then in thermal driver called gpiod_get(struct device *) to request this gpio will fail, indicate cannot find gpio in device tree, because the of node do not associate to struct device.

---
 drivers/thermal/thermal_core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/thermal/thermal_core.c +1 -0
index 0675df5..4d77d8b 100644
@@ -905,6 +905,7 @@ __thermal_cooling_device_register(struct device_node *np,
 	cdev->ops = ops;
 	cdev->updated = false;
 	cdev->device.class = thermal_class;
+	cdev->device.of_node = np;
 	cdev->devdata = devdata;
 
 	ret = cdev->ops->get_max_state(cdev, &cdev->max_state);
Signature · 1 line
2.7.4