aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sysfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sysfs.h')
-rw-r--r--include/linux/sysfs.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index f97d0dbb59fa..ddad16148bd6 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -70,6 +70,8 @@ struct attribute_group {
70 * for examples.. 70 * for examples..
71 */ 71 */
72 72
73#define SYSFS_PREALLOC 010000
74
73#define __ATTR(_name, _mode, _show, _store) { \ 75#define __ATTR(_name, _mode, _show, _store) { \
74 .attr = {.name = __stringify(_name), \ 76 .attr = {.name = __stringify(_name), \
75 .mode = VERIFY_OCTAL_PERMISSIONS(_mode) }, \ 77 .mode = VERIFY_OCTAL_PERMISSIONS(_mode) }, \
@@ -77,6 +79,13 @@ struct attribute_group {
77 .store = _store, \ 79 .store = _store, \
78} 80}
79 81
82#define __ATTR_PREALLOC(_name, _mode, _show, _store) { \
83 .attr = {.name = __stringify(_name), \
84 .mode = SYSFS_PREALLOC | VERIFY_OCTAL_PERMISSIONS(_mode) },\
85 .show = _show, \
86 .store = _store, \
87}
88
80#define __ATTR_RO(_name) { \ 89#define __ATTR_RO(_name) { \
81 .attr = { .name = __stringify(_name), .mode = S_IRUGO }, \ 90 .attr = { .name = __stringify(_name), .mode = S_IRUGO }, \
82 .show = _name##_show, \ 91 .show = _name##_show, \