diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2014-01-18 23:17:57 +0100 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2014-01-19 17:47:13 +0100 |
commit | dbb9ce491b64ce6a363ff493736245698977bbb7 (patch) | |
tree | 3ff98a1e4e4b3388734c0f26d0e23db73ebbf7f3 /backport | |
parent | ec5a825fa7b2040e412c077255301444148a5d3e (diff) |
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 <hauke@hauke-m.de>
Diffstat (limited to 'backport')
-rw-r--r-- | backport/backport-include/linux/device.h | 18 |
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) |