aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2022-05-11 06:36:29 -0700
committerGuenter Roeck <linux@roeck-us.net>2022-05-22 11:32:31 -0700
commit87743bcf08072b3e1952a0bf5524b2833e667b4c (patch)
tree6043f56501932077ac49cc3a618941967b7d70a8
parenthwmon: Introduce hwmon_device_register_for_thermal (diff)
downloadwireguard-linux-87743bcf08072b3e1952a0bf5524b2833e667b4c.tar.xz
wireguard-linux-87743bcf08072b3e1952a0bf5524b2833e667b4c.zip
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>
-rw-r--r--drivers/thermal/thermal_hwmon.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c
index ad03262cca56..09e49ec8b6f4 100644
--- a/drivers/thermal/thermal_hwmon.c
+++ b/drivers/thermal/thermal_hwmon.c
@@ -149,8 +149,8 @@ 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, NULL, NULL);
+ hwmon->device = hwmon_device_register_for_thermal(&tz->device,
+ hwmon->type, hwmon);
if (IS_ERR(hwmon->device)) {
result = PTR_ERR(hwmon->device);
goto free_mem;
@@ -277,3 +277,5 @@ int devm_thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
return ret;
}
EXPORT_SYMBOL_GPL(devm_thermal_add_hwmon_sysfs);
+
+MODULE_IMPORT_NS(HWMON_THERMAL);