summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-05-17 15:45:10 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-05-19 05:44:46 -0400
commit39572ab30feb92a8d49bf2a59c9a492ba858c008 (patch)
tree7c40b81efab5f5f8a48c64040c4c3a394311fc1e /drivers/net
parenta09c07a8c89ee910f97d09577ec30b3084fb1d6a (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.c29
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
48static int 48static int fakelb_hw_ed(struct ieee802154_hw *hw, u8 *level)
49fakelb_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
57static int 56static int fakelb_hw_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
58fakelb_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
69static int 67static int fakelb_hw_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
70fakelb_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
94static int 90static int fakelb_hw_start(struct ieee802154_hw *hw)
95fakelb_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
105static void 101static void fakelb_hw_stop(struct ieee802154_hw *hw)
106fakelb_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
127static int fakelb_add_one(struct device *dev) 123static 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)
201static int fakelb_probe(struct platform_device *pdev) 197static 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
224static int fakelb_remove(struct platform_device *pdev) 219static 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;