aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sysdev.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sysdev.h')
-rw-r--r--include/linux/sysdev.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index f752e73bf977..f2767bc6b735 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -45,12 +45,16 @@ struct sysdev_class_attribute {
45 ssize_t (*store)(struct sysdev_class *, const char *, size_t); 45 ssize_t (*store)(struct sysdev_class *, const char *, size_t);
46}; 46};
47 47
48#define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \ 48#define _SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \
49struct sysdev_class_attribute attr_##_name = { \ 49{ \
50 .attr = {.name = __stringify(_name), .mode = _mode }, \ 50 .attr = {.name = __stringify(_name), .mode = _mode }, \
51 .show = _show, \ 51 .show = _show, \
52 .store = _store, \ 52 .store = _store, \
53}; 53}
54
55#define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \
56 struct sysdev_class_attribute attr_##_name = \
57 _SYSDEV_CLASS_ATTR(_name,_mode,_show,_store)
54 58
55 59
56extern int sysdev_class_register(struct sysdev_class *); 60extern int sysdev_class_register(struct sysdev_class *);
@@ -100,15 +104,16 @@ struct sysdev_attribute {
100}; 104};
101 105
102 106
103#define _SYSDEV_ATTR(_name,_mode,_show,_store) \ 107#define _SYSDEV_ATTR(_name, _mode, _show, _store) \
104{ \ 108{ \
105 .attr = { .name = __stringify(_name), .mode = _mode }, \ 109 .attr = { .name = __stringify(_name), .mode = _mode }, \
106 .show = _show, \ 110 .show = _show, \
107 .store = _store, \ 111 .store = _store, \
108} 112}
109 113
110#define SYSDEV_ATTR(_name,_mode,_show,_store) \ 114#define SYSDEV_ATTR(_name, _mode, _show, _store) \
111struct sysdev_attribute attr_##_name = _SYSDEV_ATTR(_name,_mode,_show,_store); 115 struct sysdev_attribute attr_##_name = \
116 _SYSDEV_ATTR(_name, _mode, _show, _store);
112 117
113extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *); 118extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *);
114extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *); 119extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *);