backports: add ATTRIBUTE_GROUPS unconditionally
authorHauke Mehrtens <hauke@hauke-m.de>
Sat, 18 Jan 2014 22:17:57 +0000 (23:17 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 19 Jan 2014 16:47:13 +0000 (17:47 +0100)
net/bluetooth/hci_sysfs.c uses ATTRIBUTE_GROUPS on all kernel versions.
Now it has to be for older kernel versions as well and
__ATTRIBUTE_GROUPS is also needed for these old versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
backport/backport-include/linux/device.h
patches/collateral-evolutions/network/16-bluetooth/net_bluetooth_hci_sysfs.patch [deleted file]

index 5eda359f2639e2a25610b9e28911cf37f0148b66..aa91c6283935ffccd7e955c4c0636aeed87a1763 100644 (file)
@@ -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)
diff --git a/patches/collateral-evolutions/network/16-bluetooth/net_bluetooth_hci_sysfs.patch b/patches/collateral-evolutions/network/16-bluetooth/net_bluetooth_hci_sysfs.patch
deleted file mode 100644 (file)
index 404f588..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
---- a/net/bluetooth/hci_sysfs.c
-+++ b/net/bluetooth/hci_sysfs.c
-@@ -53,7 +53,11 @@ static struct attribute_group bt_link_gr
-       .attrs = bt_link_attrs,
- };
-+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31))
- static const struct attribute_group *bt_link_groups[] = {
-+#else
-+static struct attribute_group *bt_link_groups[] = {
-+#endif
-       &bt_link_group,
-       NULL
- };
-@@ -186,7 +190,11 @@ static struct attribute_group bt_host_gr
-       .attrs = bt_host_attrs,
- };
-+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,31))
- static const struct attribute_group *bt_host_groups[] = {
-+#else
-+static struct attribute_group *bt_host_groups[] = {
-+#endif
-       &bt_host_group,
-       NULL
- };