summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-05-05 13:47:01 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-05-13 21:04:00 +0200
commitcfb5dc0f60fbe95a10cb307cc6dae5c47f160abb (patch)
treeec032c3ea13db9633f7f69fea4928bb9a496201c /include/linux
parentd6323469bcfbda91f0aa89b7b39ad45fe822ca5d (diff)
downloadlwn-cfb5dc0f60fbe95a10cb307cc6dae5c47f160abb.tar.gz
lwn-cfb5dc0f60fbe95a10cb307cc6dae5c47f160abb.zip
thermal: hwmon: Use extra_groups for adding temperature attributes
Instead of passing NULL as the last argument to __hwmon_device_register() in hwmon_device_register_for_thermal() and then adding each temperature sysfs attribute to the hwmon device via device_create_file(), redefine hwmon_device_register_for_thermal() to take an extra_groups argument that will be passed to __hwmon_device_register(), define an attribute group with a proper .is_visible() callback for the temperature attributes and a related attribute groups pointer, and pass the latter to hwmon_device_register_for_thermal(). This causes the code to be way more straightforward and closer to what the other users of the hwmon subsystem do. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/8704209.T7Z3S40VBb@rafael.j.wysocki Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/hwmon.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h
index 301a83afbd66..a578a10baff2 100644
--- a/include/linux/hwmon.h
+++ b/include/linux/hwmon.h
@@ -477,7 +477,8 @@ hwmon_device_register_with_info(struct device *dev,
const struct attribute_group **extra_groups);
struct device *
hwmon_device_register_for_thermal(struct device *dev, const char *name,
- void *drvdata);
+ void *drvdata,
+ const struct attribute_group **extra_groups);
struct device *
devm_hwmon_device_register_with_info(struct device *dev,
const char *name, void *drvdata,