diff options
author | Jim Cromie <jim.cromie@gmail.com> | 2006-01-18 17:10:49 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-23 17:21:50 -0500 |
commit | 70adca5a9f506942ec88fb2d9d6e71ef271888b7 (patch) | |
tree | 3cd10be98bf800850881b93a8767b6af6fefa867 /include/linux/hwmon-sysfs.h | |
parent | cdf263f1c59cad9b1567e759890b9be044972856 (diff) |
[PATCH] hwmon: Refactor SENSOR_DEVICE_ATTR_2
This patch refactors SENSOR_DEVICE_ATTR_2 macro, following pattern set by
SENSOR_ATTR. First it creates a new macro SENSOR_ATTR_2() which expands
to an initialization expression, then it uses that in SENSOR_DEVICE_ATTR_2,
which declares and initializes a struct sensor_device_attribute_2.
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/linux/hwmon-sysfs.h')
-rw-r--r-- | include/linux/hwmon-sysfs.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/linux/hwmon-sysfs.h b/include/linux/hwmon-sysfs.h index dedca6a516b4..a90c09d331c1 100644 --- a/include/linux/hwmon-sysfs.h +++ b/include/linux/hwmon-sysfs.h | |||
@@ -43,11 +43,13 @@ struct sensor_device_attribute_2 { | |||
43 | #define to_sensor_dev_attr_2(_dev_attr) \ | 43 | #define to_sensor_dev_attr_2(_dev_attr) \ |
44 | container_of(_dev_attr, struct sensor_device_attribute_2, dev_attr) | 44 | container_of(_dev_attr, struct sensor_device_attribute_2, dev_attr) |
45 | 45 | ||
46 | #define SENSOR_ATTR_2(_name, _mode, _show, _store, _nr, _index) \ | ||
47 | { .dev_attr = __ATTR(_name, _mode, _show, _store), \ | ||
48 | .index = _index, \ | ||
49 | .nr = _nr } | ||
50 | |||
46 | #define SENSOR_DEVICE_ATTR_2(_name,_mode,_show,_store,_nr,_index) \ | 51 | #define SENSOR_DEVICE_ATTR_2(_name,_mode,_show,_store,_nr,_index) \ |
47 | struct sensor_device_attribute_2 sensor_dev_attr_##_name = { \ | 52 | struct sensor_device_attribute_2 sensor_dev_attr_##_name \ |
48 | .dev_attr = __ATTR(_name,_mode,_show,_store), \ | 53 | = SENSOR_ATTR_2(_name, _mode, _show, _store, _nr, _index) |
49 | .index = _index, \ | ||
50 | .nr = _nr, \ | ||
51 | } | ||
52 | 54 | ||
53 | #endif /* _LINUX_HWMON_SYSFS_H */ | 55 | #endif /* _LINUX_HWMON_SYSFS_H */ |