summaryrefslogtreecommitdiff
path: root/patches/collateral-evolutions/generic/0001-sysfs-api/net_ieee802154_wpan-class.patch
blob: 8099fabc0ec343391bd1d19a72cd1f10ca31b59c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--- a/net/ieee802154/wpan-class.c
+++ b/net/ieee802154/wpan-class.c
@@ -75,7 +75,12 @@ static struct attribute *pmib_attrs[] =
 	&dev_attr_cca_mode.attr,
 	NULL,
 };
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
 ATTRIBUTE_GROUPS(pmib);
+#else
+#define BP_ATTR_GRP_STRUCT device_attribute
+ATTRIBUTE_GROUPS_BACKPORT(pmib);
+#endif
 
 static void wpan_phy_release(struct device *d)
 {
@@ -86,7 +91,11 @@ static void wpan_phy_release(struct devi
 static struct class wpan_phy_class = {
 	.name = "ieee802154",
 	.dev_release = wpan_phy_release,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
 	.dev_groups = pmib_groups,
+#else
+	.dev_attrs = pmib_dev_attrs,
+#endif
 };
 
 static DEFINE_MUTEX(wpan_phy_mutex);
@@ -203,6 +212,7 @@ EXPORT_SYMBOL(wpan_phy_free);
 static int __init wpan_phy_class_init(void)
 {
 	int rc;
+	init_pmib_attrs();
 	rc = class_register(&wpan_phy_class);
 	if (rc)
 		goto err;