diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-24 18:05:35 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-25 19:34:40 -0400 |
commit | f0bc99c84349ce87af5b35839d19bfb17bb9b27f (patch) | |
tree | 3305f2f0be2d65be7fc0d9806c52bf3a48ce17c9 /net/wireless | |
parent | d79fd03fd651bd91a081fc97f5f0d221557f8cbb (diff) |
net: wireless: 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 networking wireless class
code to use the correct field.
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Cc: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/sysfs.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/net/wireless/sysfs.c b/net/wireless/sysfs.c index a23253e06358..9ee6bc1a7610 100644 --- a/net/wireless/sysfs.c +++ b/net/wireless/sysfs.c | |||
@@ -30,7 +30,8 @@ static ssize_t name ## _show(struct device *dev, \ | |||
30 | char *buf) \ | 30 | char *buf) \ |
31 | { \ | 31 | { \ |
32 | return sprintf(buf, fmt "\n", dev_to_rdev(dev)->member); \ | 32 | return sprintf(buf, fmt "\n", dev_to_rdev(dev)->member); \ |
33 | } | 33 | } \ |
34 | static DEVICE_ATTR_RO(name) | ||
34 | 35 | ||
35 | SHOW_FMT(index, "%d", wiphy_idx); | 36 | SHOW_FMT(index, "%d", wiphy_idx); |
36 | SHOW_FMT(macaddress, "%pM", wiphy.perm_addr); | 37 | SHOW_FMT(macaddress, "%pM", wiphy.perm_addr); |
@@ -42,7 +43,7 @@ static ssize_t name_show(struct device *dev, | |||
42 | struct wiphy *wiphy = &dev_to_rdev(dev)->wiphy; | 43 | struct wiphy *wiphy = &dev_to_rdev(dev)->wiphy; |
43 | return sprintf(buf, "%s\n", dev_name(&wiphy->dev)); | 44 | return sprintf(buf, "%s\n", dev_name(&wiphy->dev)); |
44 | } | 45 | } |
45 | 46 | static DEVICE_ATTR_RO(name); | |
46 | 47 | ||
47 | static ssize_t addresses_show(struct device *dev, | 48 | static ssize_t addresses_show(struct device *dev, |
48 | struct device_attribute *attr, | 49 | struct device_attribute *attr, |
@@ -60,15 +61,17 @@ static ssize_t addresses_show(struct device *dev, | |||
60 | 61 | ||
61 | return buf - start; | 62 | return buf - start; |
62 | } | 63 | } |
63 | 64 | static DEVICE_ATTR_RO(addresses); | |
64 | static struct device_attribute ieee80211_dev_attrs[] = { | 65 | |
65 | __ATTR_RO(index), | 66 | static struct attribute *ieee80211_attrs[] = { |
66 | __ATTR_RO(macaddress), | 67 | &dev_attr_index.attr, |
67 | __ATTR_RO(address_mask), | 68 | &dev_attr_macaddress.attr, |
68 | __ATTR_RO(addresses), | 69 | &dev_attr_address_mask.attr, |
69 | __ATTR_RO(name), | 70 | &dev_attr_addresses.attr, |
70 | {} | 71 | &dev_attr_name.attr, |
72 | NULL, | ||
71 | }; | 73 | }; |
74 | ATTRIBUTE_GROUPS(ieee80211); | ||
72 | 75 | ||
73 | static void wiphy_dev_release(struct device *dev) | 76 | static void wiphy_dev_release(struct device *dev) |
74 | { | 77 | { |
@@ -146,7 +149,7 @@ struct class ieee80211_class = { | |||
146 | .name = "ieee80211", | 149 | .name = "ieee80211", |
147 | .owner = THIS_MODULE, | 150 | .owner = THIS_MODULE, |
148 | .dev_release = wiphy_dev_release, | 151 | .dev_release = wiphy_dev_release, |
149 | .dev_attrs = ieee80211_dev_attrs, | 152 | .dev_groups = ieee80211_groups, |
150 | .dev_uevent = wiphy_uevent, | 153 | .dev_uevent = wiphy_uevent, |
151 | #ifdef CONFIG_PM | 154 | #ifdef CONFIG_PM |
152 | .suspend = wiphy_suspend, | 155 | .suspend = wiphy_suspend, |