projects
/
linux
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d06262e
)
sysfs: create __ATTR_WO()
author
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Fri, 23 Aug 2013 22:02:01 +0000
(15:02 -0700)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Fri, 23 Aug 2013 22:02:01 +0000
(15:02 -0700)
This creates the macro __ATTR_WO() for write-only attributes, instead of
having to "open define" them.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/sysfs.h
patch
|
blob
|
history
diff --git
a/include/linux/sysfs.h
b/include/linux/sysfs.h
index b5a9d9b26bd4b55f7de031896fbedaa0ea15ee91..69c1ff003628372b2b08af730d858ec0388f4d0d 100644
(file)
--- a/
include/linux/sysfs.h
+++ b/
include/linux/sysfs.h
@@
-80,6
+80,11
@@
struct attribute_group {
.show = _name##_show, \
}
+#define __ATTR_WO(_name) { \
+ .attr = { .name = __stringify(_name), .mode = S_IWUSR }, \
+ .store = _name##_store, \
+}
+
#define __ATTR_RW(_name) __ATTR(_name, (S_IWUSR | S_IRUGO), \
_name##_show, _name##_store)