sysfs.h: add ATTRIBUTE_GROUPS() macro
[pandora-kernel.git] / include / linux / sysfs.h
index 9cd20c8..f62ff01 100644 (file)
@@ -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;