diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-11-01 23:18:35 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-11-01 23:51:06 -0400 |
commit | a5dd1d72d868ec9c8f44d60ca29900b6a38321b4 (patch) | |
tree | 9710a262a7ac980362ad1459115447b75905a4a6 /net/ieee802154/sysfs.c | |
parent | fe58d016e396fc685364b5a1743faf83c1fb8103 (diff) |
cfg802154: introduce cfg802154_registered_device
This patch introduce the cfg802154_registered_device struct. Like
cfg80211_registered_device in wireless this should contain similar
functionality for cfg802154. This patch should not change any behaviour.
We just adds cfg802154_registered_device as container for wpan_phy struct.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/ieee802154/sysfs.c')
-rw-r--r-- | net/ieee802154/sysfs.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/net/ieee802154/sysfs.c b/net/ieee802154/sysfs.c index eb9ca6f99122..c6e038099e07 100644 --- a/net/ieee802154/sysfs.c +++ b/net/ieee802154/sysfs.c | |||
@@ -17,6 +17,15 @@ | |||
17 | 17 | ||
18 | #include <net/cfg802154.h> | 18 | #include <net/cfg802154.h> |
19 | 19 | ||
20 | #include "core.h" | ||
21 | |||
22 | static inline struct cfg802154_registered_device * | ||
23 | dev_to_rdev(struct device *dev) | ||
24 | { | ||
25 | return container_of(dev, struct cfg802154_registered_device, | ||
26 | wpan_phy.dev); | ||
27 | } | ||
28 | |||
20 | #define MASTER_SHOW_COMPLEX(name, format_string, args...) \ | 29 | #define MASTER_SHOW_COMPLEX(name, format_string, args...) \ |
21 | static ssize_t name ## _show(struct device *dev, \ | 30 | static ssize_t name ## _show(struct device *dev, \ |
22 | struct device_attribute *attr, char *buf) \ | 31 | struct device_attribute *attr, char *buf) \ |
@@ -60,11 +69,11 @@ static ssize_t channels_supported_show(struct device *dev, | |||
60 | } | 69 | } |
61 | static DEVICE_ATTR_RO(channels_supported); | 70 | static DEVICE_ATTR_RO(channels_supported); |
62 | 71 | ||
63 | static void wpan_phy_release(struct device *d) | 72 | static void wpan_phy_release(struct device *dev) |
64 | { | 73 | { |
65 | struct wpan_phy *phy = container_of(d, struct wpan_phy, dev); | 74 | struct cfg802154_registered_device *rdev = dev_to_rdev(dev); |
66 | 75 | ||
67 | kfree(phy); | 76 | cfg802154_dev_free(rdev); |
68 | } | 77 | } |
69 | 78 | ||
70 | static struct attribute *pmib_attrs[] = { | 79 | static struct attribute *pmib_attrs[] = { |