linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thermal/core: associate device tree node to thermal_cooling_device::device
@ 2023-02-05 14:52 Jianeng Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Jianeng Chen @ 2023-02-05 14:52 UTC (permalink / raw)
  To: linux-pm
  Cc: rafael, daniel.lezcano, amitk, rui.zhang, linux-kernel, Jianeng Chen

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.

Signed-off-by: Jianeng Chen <jianengchencool@gmail.com>
---
 drivers/thermal/thermal_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 0675df5..4d77d8b 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -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);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] thermal/core: associate device tree node to thermal_cooling_device::device
@ 2023-02-06 14:26 Jianeng Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Jianeng Chen @ 2023-02-06 14:26 UTC (permalink / raw)
  To: rafael, daniel.lezcano, amitk, rui.zhang
  Cc: linux-pm, linux-kernel, Jianeng Chen

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.

Signed-off-by: Jianeng Chen <jianengchencool@gmail.com>
---
 drivers/thermal/thermal_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 0675df5..4d77d8b 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -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);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-06 14:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-05 14:52 [PATCH] thermal/core: associate device tree node to thermal_cooling_device::device Jianeng Chen
2023-02-06 14:26 Jianeng Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).