On 03/10/18 08:25, Cao Van Dong wrote:
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
What does report this error? Is it a userspace application?
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. ---
This patch has no SoB.
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);
It is not clear to me that this is any better. What is the parent device in this case? Can you give an example of what breaks in the hierarchy?
Given how close we are to to 4.19, I'd rather we revert f6b6b52ef7a54160 if there are userspace visible regressions.
Thanks, M. -- Jazz is not dead. It just smells funny...