aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJim Cromie <jim.cromie@gmail.com>2006-01-09 17:22:24 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-23 17:21:48 -0500
commit42d3b83fecb7b576d477244347982baa02fa4f44 (patch)
tree42c799763f3b908a554f050c1b8990e5f41bb7ac /include
parentb0e6e962992b76580f4900b166a337bad7c1e81b (diff)
[PATCH] hwmon: Allow sensor attributes arrays
This patch refactors SENSOR_DEVICE_ATTR macro. First it creates a new macro SENSOR_ATTR() which expands to an initialization expression, then it uses that in SENSOR_DEVICE_ATTR, which declares and initializes a struct sensor_device_attribute. IOW, SENSOR_ATTR() imitates __ATTR() in include/linux/device.h. Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/hwmon-sysfs.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/linux/hwmon-sysfs.h b/include/linux/hwmon-sysfs.h
index 7eb4004b3601..dedca6a516b4 100644
--- a/include/linux/hwmon-sysfs.h
+++ b/include/linux/hwmon-sysfs.h
@@ -27,11 +27,13 @@ struct sensor_device_attribute{
27#define to_sensor_dev_attr(_dev_attr) \ 27#define to_sensor_dev_attr(_dev_attr) \
28 container_of(_dev_attr, struct sensor_device_attribute, dev_attr) 28 container_of(_dev_attr, struct sensor_device_attribute, dev_attr)
29 29
30#define SENSOR_DEVICE_ATTR(_name,_mode,_show,_store,_index) \ 30#define SENSOR_ATTR(_name, _mode, _show, _store, _index) \
31struct sensor_device_attribute sensor_dev_attr_##_name = { \ 31 { .dev_attr = __ATTR(_name, _mode, _show, _store), \
32 .dev_attr = __ATTR(_name,_mode,_show,_store), \ 32 .index = _index }
33 .index = _index, \ 33
34} 34#define SENSOR_DEVICE_ATTR(_name, _mode, _show, _store, _index) \
35struct sensor_device_attribute sensor_dev_attr_##_name \
36 = SENSOR_ATTR(_name, _mode, _show, _store, _index)
35 37
36struct sensor_device_attribute_2 { 38struct sensor_device_attribute_2 {
37 struct device_attribute dev_attr; 39 struct device_attribute dev_attr;