Skip to content

Commit f0bc99c

Browse files
committed
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>
1 parent d79fd03 commit f0bc99c

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

‎net/wireless/sysfs.c‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ static ssize_t name ## _show(struct device *dev, \
3030
char *buf) \
3131
{ \
3232
return sprintf(buf, fmt "\n", dev_to_rdev(dev)->member); \
33-
}
33+
} \
34+
static DEVICE_ATTR_RO(name)
3435

3536
SHOW_FMT(index, "%d", wiphy_idx);
3637
SHOW_FMT(macaddress, "%pM", wiphy.perm_addr);
@@ -42,7 +43,7 @@ static ssize_t name_show(struct device *dev,
4243
struct wiphy *wiphy = &dev_to_rdev(dev)->wiphy;
4344
return sprintf(buf, "%s\n", dev_name(&wiphy->dev));
4445
}
45-
46+
static DEVICE_ATTR_RO(name);
4647

4748
static ssize_t addresses_show(struct device *dev,
4849
struct device_attribute *attr,
@@ -60,15 +61,17 @@ static ssize_t addresses_show(struct device *dev,
6061

6162
return buf - start;
6263
}
63-
64-
static struct device_attribute ieee80211_dev_attrs[] = {
65-
__ATTR_RO(index),
66-
__ATTR_RO(macaddress),
67-
__ATTR_RO(address_mask),
68-
__ATTR_RO(addresses),
69-
__ATTR_RO(name),
70-
{}
64+
static DEVICE_ATTR_RO(addresses);
65+
66+
static struct attribute *ieee80211_attrs[] = {
67+
&dev_attr_index.attr,
68+
&dev_attr_macaddress.attr,
69+
&dev_attr_address_mask.attr,
70+
&dev_attr_addresses.attr,
71+
&dev_attr_name.attr,
72+
NULL,
7173
};
74+
ATTRIBUTE_GROUPS(ieee80211);
7275

7376
static void wiphy_dev_release(struct device *dev)
7477
{
@@ -146,7 +149,7 @@ struct class ieee80211_class = {
146149
.name = "ieee80211",
147150
.owner = THIS_MODULE,
148151
.dev_release = wiphy_dev_release,
149-
.dev_attrs = ieee80211_dev_attrs,
152+
.dev_groups = ieee80211_groups,
150153
.dev_uevent = wiphy_uevent,
151154
#ifdef CONFIG_PM
152155
.suspend = wiphy_suspend,

0 commit comments

Comments
 (0)