[PATCH 05/16] backports: add ATTRIBUTE_GROUPS unconditionally

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 backport/backport-include/linux/device.h           |   18 ++++++++++++--
 .../16-bluetooth/net_bluetooth_hci_sysfs.patch     |   26 --------------------
 2 files changed, 16 insertions(+), 28 deletions(-)
 delete mode 100644 patches/collateral-evolutions/network/16-bluetooth/net_bluetooth_hci_sysfs.patch

diff --git a/backport/backport-include/linux/device.h b/backport/backport-include/linux/device.h
index 5eda359..aa91c62 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)
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
index 404f588..0000000
--- a/patches/collateral-evolutions/network/16-bluetooth/net_bluetooth_hci_sysfs.patch
+++ /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
- };
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux