Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a65fcce7 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

sysfs: create __ATTR_WO()



This creates the macro __ATTR_WO() for write-only attributes, instead of
having to "open define" them.

Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d06262e5
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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)