aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee802154/wpan-class.c
diff options
context:
space:
mode:
authorJames Morris <james.l.morris@oracle.com>2014-11-19 05:32:12 -0500
committerJames Morris <james.l.morris@oracle.com>2014-11-19 05:32:12 -0500
commitb10778a00d40b3d9fdaaf5891e802794781ff71c (patch)
tree6ba4cbac86eecedc3f30650e7f764ecf00c83898 /net/ieee802154/wpan-class.c
parent594081ee7145cc30a3977cb4e218f81213b63dc5 (diff)
parentbfe01a5ba2490f299e1d2d5508cbbbadd897bbe9 (diff)
Merge commit 'v3.17' into next
Diffstat (limited to 'net/ieee802154/wpan-class.c')
-rw-r--r--net/ieee802154/wpan-class.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/ieee802154/wpan-class.c b/net/ieee802154/wpan-class.c
index 8d6f6704da84..4955e0fe5883 100644
--- a/net/ieee802154/wpan-class.c
+++ b/net/ieee802154/wpan-class.c
@@ -48,7 +48,8 @@ MASTER_SHOW(transmit_power, "%d +- 1 dB");
48MASTER_SHOW(cca_mode, "%d"); 48MASTER_SHOW(cca_mode, "%d");
49 49
50static ssize_t channels_supported_show(struct device *dev, 50static ssize_t channels_supported_show(struct device *dev,
51 struct device_attribute *attr, char *buf) 51 struct device_attribute *attr,
52 char *buf)
52{ 53{
53 struct wpan_phy *phy = container_of(dev, struct wpan_phy, dev); 54 struct wpan_phy *phy = container_of(dev, struct wpan_phy, dev);
54 int ret; 55 int ret;
@@ -57,7 +58,7 @@ static ssize_t channels_supported_show(struct device *dev,
57 mutex_lock(&phy->pib_lock); 58 mutex_lock(&phy->pib_lock);
58 for (i = 0; i < 32; i++) { 59 for (i = 0; i < 32; i++) {
59 ret = snprintf(buf + len, PAGE_SIZE - len, 60 ret = snprintf(buf + len, PAGE_SIZE - len,
60 "%#09x\n", phy->channels_supported[i]); 61 "%#09x\n", phy->channels_supported[i]);
61 if (ret < 0) 62 if (ret < 0)
62 break; 63 break;
63 len += ret; 64 len += ret;
@@ -80,6 +81,7 @@ ATTRIBUTE_GROUPS(pmib);
80static void wpan_phy_release(struct device *d) 81static void wpan_phy_release(struct device *d)
81{ 82{
82 struct wpan_phy *phy = container_of(d, struct wpan_phy, dev); 83 struct wpan_phy *phy = container_of(d, struct wpan_phy, dev);
84
83 kfree(phy); 85 kfree(phy);
84} 86}
85 87
@@ -121,11 +123,12 @@ static int wpan_phy_iter(struct device *dev, void *_data)
121{ 123{
122 struct wpan_phy_iter_data *wpid = _data; 124 struct wpan_phy_iter_data *wpid = _data;
123 struct wpan_phy *phy = container_of(dev, struct wpan_phy, dev); 125 struct wpan_phy *phy = container_of(dev, struct wpan_phy, dev);
126
124 return wpid->fn(phy, wpid->data); 127 return wpid->fn(phy, wpid->data);
125} 128}
126 129
127int wpan_phy_for_each(int (*fn)(struct wpan_phy *phy, void *data), 130int wpan_phy_for_each(int (*fn)(struct wpan_phy *phy, void *data),
128 void *data) 131 void *data)
129{ 132{
130 struct wpan_phy_iter_data wpid = { 133 struct wpan_phy_iter_data wpid = {
131 .fn = fn, 134 .fn = fn,
@@ -197,6 +200,7 @@ EXPORT_SYMBOL(wpan_phy_free);
197static int __init wpan_phy_class_init(void) 200static int __init wpan_phy_class_init(void)
198{ 201{
199 int rc; 202 int rc;
203
200 rc = class_register(&wpan_phy_class); 204 rc = class_register(&wpan_phy_class);
201 if (rc) 205 if (rc)
202 goto err; 206 goto err;