diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-25 00:05:34 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-27 03:05:18 +0200 |
commit | 7f4708abf16ae48e58a9190898253bc7c94a30c1 (patch) | |
tree | 018eb32b589a6154e2323ec00431a8176bf9ae6e /net/ieee802154 | |
parent | net: core: convert class code to use dev_groups (diff) | |
download | linux-7f4708abf16ae48e58a9190898253bc7c94a30c1.tar.xz linux-7f4708abf16ae48e58a9190898253bc7c94a30c1.zip |
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, \ ret = snprintf(buf, PAGE_SIZE, format_string "\n", args); \ mutex_unlock(&phy->pib_lock); \ return ret; \ -} +} \ +static DEVICE_ATTR_RO(name); #define MASTER_SHOW(field, format_string) \ MASTER_SHOW_COMPLEX(field, format_string, phy->field) @@ -66,15 +67,17 @@ static ssize_t channels_supported_show(struct device *dev, mutex_unlock(&phy->pib_lock); return len; } - -static struct device_attribute pmib_attrs[] = { - __ATTR_RO(current_channel), - __ATTR_RO(current_page), - __ATTR_RO(channels_supported), - __ATTR_RO(transmit_power), - __ATTR_RO(cca_mode), - {}, +static DEVICE_ATTR_RO(channels_supported); + +static struct attribute *pmib_attrs[] = { + &dev_attr_current_channel.attr, + &dev_attr_current_page.attr, + &dev_attr_channels_supported.attr, + &dev_attr_transmit_power.attr, + &dev_attr_cca_mode.attr, + NULL, }; +ATTRIBUTE_GROUPS(pmib); static void wpan_phy_release(struct device *d) { @@ -85,7 +88,7 @@ static void wpan_phy_release(struct device *d) static struct class wpan_phy_class = { .name = "ieee802154", .dev_release = wpan_phy_release, - .dev_attrs = pmib_attrs, + .dev_groups = pmib_groups, }; static DEFINE_MUTEX(wpan_phy_mutex); |