diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-23 15:02:01 -0700 |
---|---|---|
committer | Mathieu Poirier <mathieu.poirier@linaro.org> | 2014-12-22 10:50:40 -0700 |
commit | cf5b765ecbf6721ac2fefef4fafc86610a95927a (patch) | |
tree | 054d7d67269c33a24ed3a5a752ba293869930698 | |
parent | d1adb5fedc4a30a5eba2b720da34ea1623e6dbf4 (diff) |
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 a65fcce75a75c0d41b938f86d09d42b6f1733309)
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
-rw-r--r-- | include/linux/sysfs.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index b1dc7aa872fd..7dd65cbfcdb3 100644 --- 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) |