diff options
author | Greg Kroah-Hartman | 2013-08-24 00:02:01 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2013-08-24 00:02:01 +0200 |
commit | a65fcce75a75c0d41b938f86d09d42b6f1733309 (patch) | |
tree | 177f26e54822c42aac33b21320efee8abd3f3cc8 /include/linux/sysfs.h | |
parent | driver-core: platform: convert bus code to use dev_groups (diff) | |
download | kernel-qcow2-linux-a65fcce75a75c0d41b938f86d09d42b6f1733309.tar.gz kernel-qcow2-linux-a65fcce75a75c0d41b938f86d09d42b6f1733309.tar.xz kernel-qcow2-linux-a65fcce75a75c0d41b938f86d09d42b6f1733309.zip |
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>
Diffstat (limited to 'include/linux/sysfs.h')
-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 b5a9d9b26bd4..69c1ff003628 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) |