aboutsummaryrefslogtreecommitdiffstats
path: root/sysfs.h-add-attribute_groups-macro.patch
diff options
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-13 00:01:22 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-13 00:01:22 -0700
commitaeced238faea151e353a82fd176557418141e0dc (patch)
tree9e72ceb99eda68ae14e27d4af2487b46e02240a6 /sysfs.h-add-attribute_groups-macro.patch
parent41278505416d0546bc2988bcb6c71538c5b3db88 (diff)
parent6e9f440490ff7de2f449e4d9fdc9c6658ffc11e7 (diff)
downloadpatches-aeced238faea151e353a82fd176557418141e0dc.tar.gz
Merge branch 'master' of ra.kernel.org:/pub/scm/linux/kernel/git/gregkh/patches
Conflicts: 0001-kdbus-interprocess-message-router.patch
Diffstat (limited to 'sysfs.h-add-attribute_groups-macro.patch')
-rw-r--r--sysfs.h-add-attribute_groups-macro.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/sysfs.h-add-attribute_groups-macro.patch b/sysfs.h-add-attribute_groups-macro.patch
new file mode 100644
index 00000000000000..31816858e04505
--- /dev/null
+++ b/sysfs.h-add-attribute_groups-macro.patch
@@ -0,0 +1,33 @@
+From foo@baz Mon Jul 8 16:40:50 PDT 2013
+Date: Mon, 08 Jul 2013 16:40:50 -0700
+To: Greg KH <gregkh@linuxfoundation.org>
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Subject: sysfs.h: add ATTRIBUTE_GROUPS() macro
+
+To make it easier for driver subsystems to work with attribute groups,
+create the ATTRIBUTE_GROUPS macro to remove some of the repetitive
+typing for the most common use for attribute groups.
+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/linux/sysfs.h | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/include/linux/sysfs.h
++++ b/include/linux/sysfs.h
+@@ -94,6 +94,15 @@ struct attribute_group {
+ #define __ATTR_IGNORE_LOCKDEP __ATTR
+ #endif
+
++#define ATTRIBUTE_GROUPS(name) \
++static const struct attribute_group name##_group = { \
++ .attrs = name##_attrs, \
++}; \
++static const struct attribute_group *name##_groups[] = { \
++ &name##_group, \
++ NULL, \
++}
++
+ #define attr_name(_attr) (_attr).attr.name
+
+ struct file;