diff options
Diffstat (limited to 'include/linux/hwmon-sysfs.h')
-rw-r--r-- | include/linux/hwmon-sysfs.h | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/include/linux/hwmon-sysfs.h b/include/linux/hwmon-sysfs.h index 7eb4004b3601..a90c09d331c1 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) \ |
31 | struct 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) \ |
35 | struct sensor_device_attribute sensor_dev_attr_##_name \ | ||
36 | = SENSOR_ATTR(_name, _mode, _show, _store, _index) | ||
35 | 37 | ||
36 | struct sensor_device_attribute_2 { | 38 | struct sensor_device_attribute_2 { |
37 | struct device_attribute dev_attr; | 39 | struct device_attribute dev_attr; |
@@ -41,11 +43,13 @@ struct sensor_device_attribute_2 { | |||
41 | #define to_sensor_dev_attr_2(_dev_attr) \ | 43 | #define to_sensor_dev_attr_2(_dev_attr) \ |
42 | container_of(_dev_attr, struct sensor_device_attribute_2, dev_attr) | 44 | container_of(_dev_attr, struct sensor_device_attribute_2, dev_attr) |
43 | 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 | |||
44 | #define SENSOR_DEVICE_ATTR_2(_name,_mode,_show,_store,_nr,_index) \ | 51 | #define SENSOR_DEVICE_ATTR_2(_name,_mode,_show,_store,_nr,_index) \ |
45 | struct sensor_device_attribute_2 sensor_dev_attr_##_name = { \ | 52 | struct sensor_device_attribute_2 sensor_dev_attr_##_name \ |
46 | .dev_attr = __ATTR(_name,_mode,_show,_store), \ | 53 | = SENSOR_ATTR_2(_name, _mode, _show, _store, _nr, _index) |
47 | .index = _index, \ | ||
48 | .nr = _nr, \ | ||
49 | } | ||
50 | 54 | ||
51 | #endif /* _LINUX_HWMON_SYSFS_H */ | 55 | #endif /* _LINUX_HWMON_SYSFS_H */ |