mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 04:48:04 +09:00
sysfs: create __ATTR_WO()
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>
(cherry picked from commit a65fcce75a)
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
This commit is contained in:
committed by
Mathieu Poirier
parent
d1adb5fedc
commit
cf5b765ecb
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user