Skip to content

Commit 87743bc

Browse files
committed
thermal/drivers/thermal_hwmon: Use hwmon_device_register_for_thermal()
The thermal subsystem registers a hwmon device without providing chip information or sysfs attribute groups. While undesirable, it would be difficult to change. On the other side, it abuses the hwmon_device_register_with_info API by not providing that information. Use new API specifically created for the thermal subsystem instead to let us enforce the 'chip' parameter for other callers of hwmon_device_register_with_info(). Acked-by: Rafael J . Wysocki <rafael@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent e5d2107 commit 87743bc

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/thermal/thermal_hwmon.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
149149
INIT_LIST_HEAD(&hwmon->tz_list);
150150
strlcpy(hwmon->type, tz->type, THERMAL_NAME_LENGTH);
151151
strreplace(hwmon->type, '-', '_');
152-
hwmon->device = hwmon_device_register_with_info(&tz->device, hwmon->type,
153-
hwmon, NULL, NULL);
152+
hwmon->device = hwmon_device_register_for_thermal(&tz->device,
153+
hwmon->type, hwmon);
154154
if (IS_ERR(hwmon->device)) {
155155
result = PTR_ERR(hwmon->device);
156156
goto free_mem;
@@ -277,3 +277,5 @@ int devm_thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
277277
return ret;
278278
}
279279
EXPORT_SYMBOL_GPL(devm_thermal_add_hwmon_sysfs);
280+
281+
MODULE_IMPORT_NS(HWMON_THERMAL);

0 commit comments

Comments
 (0)