diff options
author | Alexander Aring <alex.aring@gmail.com> | 2015-05-17 15:45:10 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-05-19 05:44:46 -0400 |
commit | 39572ab30feb92a8d49bf2a59c9a492ba858c008 (patch) | |
tree | 7c40b81efab5f5f8a48c64040c4c3a394311fc1e /drivers/net | |
parent | a09c07a8c89ee910f97d09577ec30b3084fb1d6a (diff) |
fakelb: cleanup code
This patch just cleanups the code at several places.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ieee802154/fakelb.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c index 8f37ea0fa1f5..9d0da4ec3e8c 100644 --- a/drivers/net/ieee802154/fakelb.c +++ b/drivers/net/ieee802154/fakelb.c | |||
@@ -45,8 +45,7 @@ struct fakelb_phy { | |||
45 | struct list_head list_ifup; | 45 | struct list_head list_ifup; |
46 | }; | 46 | }; |
47 | 47 | ||
48 | static int | 48 | static int fakelb_hw_ed(struct ieee802154_hw *hw, u8 *level) |
49 | fakelb_hw_ed(struct ieee802154_hw *hw, u8 *level) | ||
50 | { | 49 | { |
51 | BUG_ON(!level); | 50 | BUG_ON(!level); |
52 | *level = 0xbe; | 51 | *level = 0xbe; |
@@ -54,8 +53,7 @@ fakelb_hw_ed(struct ieee802154_hw *hw, u8 *level) | |||
54 | return 0; | 53 | return 0; |
55 | } | 54 | } |
56 | 55 | ||
57 | static int | 56 | static int fakelb_hw_channel(struct ieee802154_hw *hw, u8 page, u8 channel) |
58 | fakelb_hw_channel(struct ieee802154_hw *hw, u8 page, u8 channel) | ||
59 | { | 57 | { |
60 | struct fakelb_phy *phy = hw->priv; | 58 | struct fakelb_phy *phy = hw->priv; |
61 | 59 | ||
@@ -66,11 +64,9 @@ fakelb_hw_channel(struct ieee802154_hw *hw, u8 page, u8 channel) | |||
66 | return 0; | 64 | return 0; |
67 | } | 65 | } |
68 | 66 | ||
69 | static int | 67 | static int fakelb_hw_xmit(struct ieee802154_hw *hw, struct sk_buff *skb) |
70 | fakelb_hw_xmit(struct ieee802154_hw *hw, struct sk_buff *skb) | ||
71 | { | 68 | { |
72 | struct fakelb_phy *current_phy = hw->priv; | 69 | struct fakelb_phy *current_phy = hw->priv, *phy; |
73 | struct fakelb_phy *phy; | ||
74 | 70 | ||
75 | read_lock_bh(&fakelb_ifup_phys_lock); | 71 | read_lock_bh(&fakelb_ifup_phys_lock); |
76 | list_for_each_entry(phy, &fakelb_ifup_phys, list_ifup) { | 72 | list_for_each_entry(phy, &fakelb_ifup_phys, list_ifup) { |
@@ -91,8 +87,8 @@ fakelb_hw_xmit(struct ieee802154_hw *hw, struct sk_buff *skb) | |||
91 | return 0; | 87 | return 0; |
92 | } | 88 | } |
93 | 89 | ||
94 | static int | 90 | static int fakelb_hw_start(struct ieee802154_hw *hw) |
95 | fakelb_hw_start(struct ieee802154_hw *hw) { | 91 | { |
96 | struct fakelb_phy *phy = hw->priv; | 92 | struct fakelb_phy *phy = hw->priv; |
97 | 93 | ||
98 | write_lock_bh(&fakelb_ifup_phys_lock); | 94 | write_lock_bh(&fakelb_ifup_phys_lock); |
@@ -102,8 +98,8 @@ fakelb_hw_start(struct ieee802154_hw *hw) { | |||
102 | return 0; | 98 | return 0; |
103 | } | 99 | } |
104 | 100 | ||
105 | static void | 101 | static void fakelb_hw_stop(struct ieee802154_hw *hw) |
106 | fakelb_hw_stop(struct ieee802154_hw *hw) { | 102 | { |
107 | struct fakelb_phy *phy = hw->priv; | 103 | struct fakelb_phy *phy = hw->priv; |
108 | 104 | ||
109 | write_lock_bh(&fakelb_ifup_phys_lock); | 105 | write_lock_bh(&fakelb_ifup_phys_lock); |
@@ -126,9 +122,9 @@ MODULE_PARM_DESC(numlbs, " number of pseudo devices"); | |||
126 | 122 | ||
127 | static int fakelb_add_one(struct device *dev) | 123 | static int fakelb_add_one(struct device *dev) |
128 | { | 124 | { |
125 | struct ieee802154_hw *hw; | ||
129 | struct fakelb_phy *phy; | 126 | struct fakelb_phy *phy; |
130 | int err; | 127 | int err; |
131 | struct ieee802154_hw *hw; | ||
132 | 128 | ||
133 | hw = ieee802154_alloc_hw(sizeof(*phy), &fakelb_ops); | 129 | hw = ieee802154_alloc_hw(sizeof(*phy), &fakelb_ops); |
134 | if (!hw) | 130 | if (!hw) |
@@ -201,8 +197,7 @@ static void fakelb_del(struct fakelb_phy *phy) | |||
201 | static int fakelb_probe(struct platform_device *pdev) | 197 | static int fakelb_probe(struct platform_device *pdev) |
202 | { | 198 | { |
203 | struct fakelb_phy *phy, *tmp; | 199 | struct fakelb_phy *phy, *tmp; |
204 | int err = -ENOMEM; | 200 | int err, i; |
205 | int i; | ||
206 | 201 | ||
207 | for (i = 0; i < numlbs; i++) { | 202 | for (i = 0; i < numlbs; i++) { |
208 | err = fakelb_add_one(&pdev->dev); | 203 | err = fakelb_add_one(&pdev->dev); |
@@ -223,10 +218,10 @@ err_slave: | |||
223 | 218 | ||
224 | static int fakelb_remove(struct platform_device *pdev) | 219 | static int fakelb_remove(struct platform_device *pdev) |
225 | { | 220 | { |
226 | struct fakelb_phy *phy, *temp; | 221 | struct fakelb_phy *phy, *tmp; |
227 | 222 | ||
228 | spin_lock(&fakelb_phys_lock); | 223 | spin_lock(&fakelb_phys_lock); |
229 | list_for_each_entry_safe(phy, temp, &fakelb_phys, list) | 224 | list_for_each_entry_safe(phy, tmp, &fakelb_phys, list) |
230 | fakelb_del(phy); | 225 | fakelb_del(phy); |
231 | spin_unlock(&fakelb_phys_lock); | 226 | spin_unlock(&fakelb_phys_lock); |
232 | return 0; | 227 | return 0; |