summaryrefslogtreecommitdiff
path: root/backport
diff options
context:
space:
mode:
Diffstat (limited to 'backport')
-rw-r--r--backport/backport-include/linux/device.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h
index 5eda359f..aa91c628 100644
--- a/backport/backport-include/linux/device.h
+++ b/backport/backport-include/linux/device.h
@@ -211,7 +211,22 @@ static void init_##_name##_attrs(void) \
attr); \
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
+#ifndef __ATTRIBUTE_GROUPS
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31))
+#define __ATTRIBUTE_GROUPS(_name) \
+static const struct attribute_group *_name##_groups[] = { \
+ &_name##_group, \
+ NULL, \
+}
+#else
+#define __ATTRIBUTE_GROUPS(_name) \
+static struct attribute_group *_name##_groups[] = { \
+ &_name##_group, \
+ NULL, \
+}
+#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31)) */
+#endif /* __ATTRIBUTE_GROUPS */
+
#undef ATTRIBUTE_GROUPS
#define ATTRIBUTE_GROUPS(_name) \
static const struct attribute_group _name##_group = { \
@@ -219,7 +234,6 @@ static const struct attribute_group _name##_group = { \
}; \
static inline void init_##_name##_attrs(void) {} \
__ATTRIBUTE_GROUPS(_name)
-#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
#define dev_get_platdata LINUX_BACKPORT(dev_get_platdata)