diff options
Diffstat (limited to 'net/ieee802154/wpan-class.c')
-rw-r--r-- | net/ieee802154/wpan-class.c | 10 |
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"); | |||
48 | MASTER_SHOW(cca_mode, "%d"); | 48 | MASTER_SHOW(cca_mode, "%d"); |
49 | 49 | ||
50 | static ssize_t channels_supported_show(struct device *dev, | 50 | static 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); | |||
80 | static void wpan_phy_release(struct device *d) | 81 | static 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 | ||
127 | int wpan_phy_for_each(int (*fn)(struct wpan_phy *phy, void *data), | 130 | int 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); | |||
197 | static int __init wpan_phy_class_init(void) | 200 | static 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; |