diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-24 18:05:34 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-26 21:05:18 -0400 |
commit | 7f4708abf16ae48e58a9190898253bc7c94a30c1 (patch) | |
tree | 018eb32b589a6154e2323ec00431a8176bf9ae6e /net/ieee802154 | |
parent | 6be8aeef348a7a4a18b7406aed5de951e6125c2d (diff) |
net: ieee802154: convert class code to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead. This converts the ieee802154 class code to use
the correct field.
Acked-by: David S. Miller <davem@davemloft.net>
Cc: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ieee802154')
-rw-r--r-- | net/ieee802154/wpan-class.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/net/ieee802154/wpan-class.c b/net/ieee802154/wpan-class.c index 13571eae6bae..ef56ab5b35fe 100644 --- a/net/ieee802154/wpan-class.c +++ b/net/ieee802154/wpan-class.c | |||
@@ -36,7 +36,8 @@ static ssize_t name ## _show(struct device *dev, \ | |||
36 | ret = snprintf(buf, PAGE_SIZE, format_string "\n", args); \ | 36 | ret = snprintf(buf, PAGE_SIZE, format_string "\n", args); \ |
37 | mutex_unlock(&phy->pib_lock); \ | 37 | mutex_unlock(&phy->pib_lock); \ |
38 | return ret; \ | 38 | return ret; \ |
39 | } | 39 | } \ |
40 | static DEVICE_ATTR_RO(name); | ||
40 | 41 | ||
41 | #define MASTER_SHOW(field, format_string) \ | 42 | #define MASTER_SHOW(field, format_string) \ |
42 | MASTER_SHOW_COMPLEX(field, format_string, phy->field) | 43 | MASTER_SHOW_COMPLEX(field, format_string, phy->field) |
@@ -66,15 +67,17 @@ static ssize_t channels_supported_show(struct device *dev, | |||
66 | mutex_unlock(&phy->pib_lock); | 67 | mutex_unlock(&phy->pib_lock); |
67 | return len; | 68 | return len; |
68 | } | 69 | } |
69 | 70 | static DEVICE_ATTR_RO(channels_supported); | |
70 | static struct device_attribute pmib_attrs[] = { | 71 | |
71 | __ATTR_RO(current_channel), | 72 | static struct attribute *pmib_attrs[] = { |
72 | __ATTR_RO(current_page), | 73 | &dev_attr_current_channel.attr, |
73 | __ATTR_RO(channels_supported), | 74 | &dev_attr_current_page.attr, |
74 | __ATTR_RO(transmit_power), | 75 | &dev_attr_channels_supported.attr, |
75 | __ATTR_RO(cca_mode), | 76 | &dev_attr_transmit_power.attr, |
76 | {}, | 77 | &dev_attr_cca_mode.attr, |
78 | NULL, | ||
77 | }; | 79 | }; |
80 | ATTRIBUTE_GROUPS(pmib); | ||
78 | 81 | ||
79 | static void wpan_phy_release(struct device *d) | 82 | static void wpan_phy_release(struct device *d) |
80 | { | 83 | { |
@@ -85,7 +88,7 @@ static void wpan_phy_release(struct device *d) | |||
85 | static struct class wpan_phy_class = { | 88 | static struct class wpan_phy_class = { |
86 | .name = "ieee802154", | 89 | .name = "ieee802154", |
87 | .dev_release = wpan_phy_release, | 90 | .dev_release = wpan_phy_release, |
88 | .dev_attrs = pmib_attrs, | 91 | .dev_groups = pmib_groups, |
89 | }; | 92 | }; |
90 | 93 | ||
91 | static DEFINE_MUTEX(wpan_phy_mutex); | 94 | static DEFINE_MUTEX(wpan_phy_mutex); |