summaryrefslogtreecommitdiff
path: root/include/linux/sysfs.h
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2015-03-12 09:58:28 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-25 13:28:58 +0100
commitba61af6f3e4766c76aec0b5e7f2bb8277e1acdd0 (patch)
treefd3720b54a1be4e2ac3367fa953c78af0c4c5160 /include/linux/sysfs.h
parentd8bf8c92e80fed9119eb222c7e5cc88acf57c12c (diff)
downloadlwn-ba61af6f3e4766c76aec0b5e7f2bb8277e1acdd0.tar.gz
lwn-ba61af6f3e4766c76aec0b5e7f2bb8277e1acdd0.zip
sysfs: Document struct attribute_group
Document variables defined in struct attribute_group to ensure correct usage. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/sysfs.h')
-rw-r--r--include/linux/sysfs.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index ddad16148bd6..99382c0df17e 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -57,6 +57,21 @@ do { \
#define sysfs_attr_init(attr) do {} while (0)
#endif
+/**
+ * struct attribute_group - data structure used to declare an attribute group.
+ * @name: Optional: Attribute group name
+ * If specified, the attribute group will be created in
+ * a new subdirectory with this name.
+ * @is_visible: Optional: Function to return permissions associated with an
+ * attribute of the group. Will be called repeatedly for each
+ * attribute in the group. Only read/write permissions as well as
+ * SYSFS_PREALLOC are accepted. Must return 0 if an attribute is
+ * not visible. The returned value will replace static permissions
+ * defined in struct attribute or struct bin_attribute.
+ * @attrs: Pointer to NULL terminated list of attributes.
+ * @bin_attrs: Pointer to NULL terminated list of binary attributes.
+ * Either attrs or bin_attrs or both must be provided.
+ */
struct attribute_group {
const char *name;
umode_t (*is_visible)(struct kobject *,