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>
This commit is contained in:
parent
d79fd03fd6
commit
f0bc99c843
1 changed files with 13 additions and 10 deletions
|
@ -30,7 +30,8 @@ static ssize_t name ## _show(struct device *dev, \
|
||||||
char *buf) \
|
char *buf) \
|
||||||
{ \
|
{ \
|
||||||
return sprintf(buf, fmt "\n", dev_to_rdev(dev)->member); \
|
return sprintf(buf, fmt "\n", dev_to_rdev(dev)->member); \
|
||||||
}
|
} \
|
||||||
|
static DEVICE_ATTR_RO(name)
|
||||||
|
|
||||||
SHOW_FMT(index, "%d", wiphy_idx);
|
SHOW_FMT(index, "%d", wiphy_idx);
|
||||||
SHOW_FMT(macaddress, "%pM", wiphy.perm_addr);
|
SHOW_FMT(macaddress, "%pM", wiphy.perm_addr);
|
||||||
|
@ -42,7 +43,7 @@ static ssize_t name_show(struct device *dev,
|
||||||
struct wiphy *wiphy = &dev_to_rdev(dev)->wiphy;
|
struct wiphy *wiphy = &dev_to_rdev(dev)->wiphy;
|
||||||
return sprintf(buf, "%s\n", dev_name(&wiphy->dev));
|
return sprintf(buf, "%s\n", dev_name(&wiphy->dev));
|
||||||
}
|
}
|
||||||
|
static DEVICE_ATTR_RO(name);
|
||||||
|
|
||||||
static ssize_t addresses_show(struct device *dev,
|
static ssize_t addresses_show(struct device *dev,
|
||||||
struct device_attribute *attr,
|
struct device_attribute *attr,
|
||||||
|
@ -60,15 +61,17 @@ static ssize_t addresses_show(struct device *dev,
|
||||||
|
|
||||||
return buf - start;
|
return buf - start;
|
||||||
}
|
}
|
||||||
|
static DEVICE_ATTR_RO(addresses);
|
||||||
|
|
||||||
static struct device_attribute ieee80211_dev_attrs[] = {
|
static struct attribute *ieee80211_attrs[] = {
|
||||||
__ATTR_RO(index),
|
&dev_attr_index.attr,
|
||||||
__ATTR_RO(macaddress),
|
&dev_attr_macaddress.attr,
|
||||||
__ATTR_RO(address_mask),
|
&dev_attr_address_mask.attr,
|
||||||
__ATTR_RO(addresses),
|
&dev_attr_addresses.attr,
|
||||||
__ATTR_RO(name),
|
&dev_attr_name.attr,
|
||||||
{}
|
NULL,
|
||||||
};
|
};
|
||||||
|
ATTRIBUTE_GROUPS(ieee80211);
|
||||||
|
|
||||||
static void wiphy_dev_release(struct device *dev)
|
static void wiphy_dev_release(struct device *dev)
|
||||||
{
|
{
|
||||||
|
@ -146,7 +149,7 @@ struct class ieee80211_class = {
|
||||||
.name = "ieee80211",
|
.name = "ieee80211",
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.dev_release = wiphy_dev_release,
|
.dev_release = wiphy_dev_release,
|
||||||
.dev_attrs = ieee80211_dev_attrs,
|
.dev_groups = ieee80211_groups,
|
||||||
.dev_uevent = wiphy_uevent,
|
.dev_uevent = wiphy_uevent,
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
.suspend = wiphy_suspend,
|
.suspend = wiphy_suspend,
|
||||||
|
|
Loading…
Reference in a new issue