summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/kernel_ver.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <greg@kroah.com>2014-10-28 09:27:50 +0800
committerGreg Kroah-Hartman <greg@kroah.com>2014-10-28 09:27:50 +0800
commitf348964c266c6b2db80af8b7a75a6f9ef566f1c3 (patch)
treea03bad08838ffaca964fb10b27ee1ca80a34ae4d /drivers/staging/greybus/kernel_ver.h
parenteec5883f5179367821ab5102be897231dc64fa62 (diff)
greybus: kernel_ver.h: add ATTRIBUTE_GROUPS() macro for older kernels
This was added in 3.11, and we need it for 3.10 Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Diffstat (limited to 'drivers/staging/greybus/kernel_ver.h')
-rw-r--r--drivers/staging/greybus/kernel_ver.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/staging/greybus/kernel_ver.h b/drivers/staging/greybus/kernel_ver.h
index e0fea182c3b5..e4cda5ce65fa 100644
--- a/drivers/staging/greybus/kernel_ver.h
+++ b/drivers/staging/greybus/kernel_ver.h
@@ -48,4 +48,19 @@ static inline void gb_gpiochip_remove(struct gpio_chip *chip)
}
#endif
+/*
+ * ATTRIBUTE_GROUPS showed up in 3.11-rc2, but we need to build on 3.10, so add
+ * it here.
+ */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
+#define ATTRIBUTE_GROUPS(name) \
+static const struct attribute_group name##_group = { \
+ .attrs = name##_attrs, \
+}; \
+static const struct attribute_group *name##_groups[] = { \
+ &name##_group, \
+ NULL, \
+}
+#endif
+
#endif /* __GREYBUS_KERNEL_VER_H */