diff options
author | Michael Buesch <mb@bu3sch.de> | 2007-09-19 12:51:38 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:52:20 -0400 |
commit | b85b3b7af52d1c1bd45bfcd47aa425a15fda45f7 (patch) | |
tree | 41b001e42407a29fa7f1cf57667b8ff4379faabb | |
parent | 90f4dd0f4ba910b86f387874ed990ca69c0951a5 (diff) |
[B43]: Don't lock irq_lock in debugfs txpower adjust
It's not required and the txpower adjustment must not be in atomic.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/wireless/b43/debugfs.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/net/wireless/b43/debugfs.c b/drivers/net/wireless/b43/debugfs.c index 3aafde9f08a8..734e70e1a06d 100644 --- a/drivers/net/wireless/b43/debugfs.c +++ b/drivers/net/wireless/b43/debugfs.c | |||
@@ -223,15 +223,10 @@ out: | |||
223 | static int txpower_g_write_file(struct b43_wldev *dev, | 223 | static int txpower_g_write_file(struct b43_wldev *dev, |
224 | const char *buf, size_t count) | 224 | const char *buf, size_t count) |
225 | { | 225 | { |
226 | unsigned long flags; | ||
227 | unsigned long phy_flags; | 226 | unsigned long phy_flags; |
228 | int err = 0; | ||
229 | 227 | ||
230 | spin_lock_irqsave(&dev->wl->irq_lock, flags); | 228 | if (dev->phy.type != B43_PHYTYPE_G) |
231 | if (dev->phy.type != B43_PHYTYPE_G) { | 229 | return -ENODEV; |
232 | err = -ENODEV; | ||
233 | goto out_unlock; | ||
234 | } | ||
235 | if ((count >= 4) && (memcmp(buf, "auto", 4) == 0)) { | 230 | if ((count >= 4) && (memcmp(buf, "auto", 4) == 0)) { |
236 | /* Automatic control */ | 231 | /* Automatic control */ |
237 | dev->phy.manual_txpower_control = 0; | 232 | dev->phy.manual_txpower_control = 0; |
@@ -240,10 +235,8 @@ static int txpower_g_write_file(struct b43_wldev *dev, | |||
240 | int bbatt = 0, rfatt = 0, txmix = 0, pa2db = 0, pa3db = 0; | 235 | int bbatt = 0, rfatt = 0, txmix = 0, pa2db = 0, pa3db = 0; |
241 | /* Manual control */ | 236 | /* Manual control */ |
242 | if (sscanf(buf, "%d %d %d %d %d", &bbatt, &rfatt, | 237 | if (sscanf(buf, "%d %d %d %d %d", &bbatt, &rfatt, |
243 | &txmix, &pa2db, &pa3db) != 5) { | 238 | &txmix, &pa2db, &pa3db) != 5) |
244 | err = -EINVAL; | 239 | return -EINVAL; |
245 | goto out_unlock; | ||
246 | } | ||
247 | b43_put_attenuation_into_ranges(dev, &bbatt, &rfatt); | 240 | b43_put_attenuation_into_ranges(dev, &bbatt, &rfatt); |
248 | dev->phy.manual_txpower_control = 1; | 241 | dev->phy.manual_txpower_control = 1; |
249 | dev->phy.bbatt.att = bbatt; | 242 | dev->phy.bbatt.att = bbatt; |
@@ -262,10 +255,8 @@ static int txpower_g_write_file(struct b43_wldev *dev, | |||
262 | b43_radio_unlock(dev); | 255 | b43_radio_unlock(dev); |
263 | b43_phy_unlock(dev, phy_flags); | 256 | b43_phy_unlock(dev, phy_flags); |
264 | } | 257 | } |
265 | out_unlock: | ||
266 | spin_unlock_irqrestore(&dev->wl->irq_lock, flags); | ||
267 | 258 | ||
268 | return err; | 259 | return 0; |
269 | } | 260 | } |
270 | 261 | ||
271 | /* wl->irq_lock is locked */ | 262 | /* wl->irq_lock is locked */ |