From dbb9ce491b64ce6a363ff493736245698977bbb7 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 18 Jan 2014 23:17:57 +0100 Subject: [PATCH] backports: add ATTRIBUTE_GROUPS unconditionally 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 --- backport/backport-include/linux/device.h | 18 +++++++++++-- .../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 5eda359f2639..aa91c6283935 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 404f5882b8e6..000000000000 --- 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 - }; -- 2.30.2