All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] thermal_hwmon: Fix the 'No sensors found' error after replacing the parameter NULL by the actual device
@ 2018-10-03  7:25 Cao Van Dong
  2018-10-03  7:35 ` Geert Uytterhoeven
  2018-10-03  8:07 ` Marc Zyngier
  0 siblings, 2 replies; 5+ messages in thread
From: Cao Van Dong @ 2018-10-03  7:25 UTC (permalink / raw)
  To: broonie, geert+renesas, linux-pm
  Cc: marc.zyngier, kuninori.morimoto.gx, yoshihiro.shimoda.uh,
	linux-renesas-soc, h-inayoshi, nv-dung, na-hoan, cv-dong

Formerly, when registering the hwmon device, we pass NULL as the device. It's not a problem.
Recently, the developer has replaced the parameter NULL as the device by the actual device.
This causes the "No sensors found" error. Therefore, instead of using the device we will use pass
the parent of that device as parameter. This will sync with the processor on the hwmon core.
This patch is to fix this error.

This patch is based on the v4.19-rc3 tag.

---
 drivers/thermal/thermal_hwmon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c
index 40c69a5..a918ba9 100644
--- a/drivers/thermal/thermal_hwmon.c
+++ b/drivers/thermal/thermal_hwmon.c
@@ -143,7 +143,7 @@ int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
 	INIT_LIST_HEAD(&hwmon->tz_list);
 	strlcpy(hwmon->type, tz->type, THERMAL_NAME_LENGTH);
 	strreplace(hwmon->type, '-', '_');
-	hwmon->device = hwmon_device_register_with_info(&tz->device, hwmon->type,
+	hwmon->device = hwmon_device_register_with_info(tz->device.parent, hwmon->type,
 							hwmon, NULL, NULL);
 	if (IS_ERR(hwmon->device)) {
 		result = PTR_ERR(hwmon->device);
-- 
2.7.4

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

end of thread, other threads:[~2018-10-04 23:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-03  7:25 [PATCH v2] thermal_hwmon: Fix the 'No sensors found' error after replacing the parameter NULL by the actual device Cao Van Dong
2018-10-03  7:35 ` Geert Uytterhoeven
2018-10-03  8:07 ` Marc Zyngier
2018-10-04  1:29   ` Cao Van Dong
2018-10-04 16:56     ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.