mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
[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>
This commit is contained in:
parent
90f4dd0f4b
commit
b85b3b7af5
1 changed files with 5 additions and 14 deletions
|
@ -223,15 +223,10 @@ static ssize_t txpower_g_read_file(struct b43_wldev *dev,
|
||||||
static int txpower_g_write_file(struct b43_wldev *dev,
|
static int txpower_g_write_file(struct b43_wldev *dev,
|
||||||
const char *buf, size_t count)
|
const char *buf, size_t count)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
|
||||||
unsigned long phy_flags;
|
unsigned long phy_flags;
|
||||||
int err = 0;
|
|
||||||
|
|
||||||
spin_lock_irqsave(&dev->wl->irq_lock, flags);
|
if (dev->phy.type != B43_PHYTYPE_G)
|
||||||
if (dev->phy.type != B43_PHYTYPE_G) {
|
return -ENODEV;
|
||||||
err = -ENODEV;
|
|
||||||
goto out_unlock;
|
|
||||||
}
|
|
||||||
if ((count >= 4) && (memcmp(buf, "auto", 4) == 0)) {
|
if ((count >= 4) && (memcmp(buf, "auto", 4) == 0)) {
|
||||||
/* Automatic control */
|
/* Automatic control */
|
||||||
dev->phy.manual_txpower_control = 0;
|
dev->phy.manual_txpower_control = 0;
|
||||||
|
@ -240,10 +235,8 @@ static int txpower_g_write_file(struct b43_wldev *dev,
|
||||||
int bbatt = 0, rfatt = 0, txmix = 0, pa2db = 0, pa3db = 0;
|
int bbatt = 0, rfatt = 0, txmix = 0, pa2db = 0, pa3db = 0;
|
||||||
/* Manual control */
|
/* Manual control */
|
||||||
if (sscanf(buf, "%d %d %d %d %d", &bbatt, &rfatt,
|
if (sscanf(buf, "%d %d %d %d %d", &bbatt, &rfatt,
|
||||||
&txmix, &pa2db, &pa3db) != 5) {
|
&txmix, &pa2db, &pa3db) != 5)
|
||||||
err = -EINVAL;
|
return -EINVAL;
|
||||||
goto out_unlock;
|
|
||||||
}
|
|
||||||
b43_put_attenuation_into_ranges(dev, &bbatt, &rfatt);
|
b43_put_attenuation_into_ranges(dev, &bbatt, &rfatt);
|
||||||
dev->phy.manual_txpower_control = 1;
|
dev->phy.manual_txpower_control = 1;
|
||||||
dev->phy.bbatt.att = bbatt;
|
dev->phy.bbatt.att = bbatt;
|
||||||
|
@ -262,10 +255,8 @@ static int txpower_g_write_file(struct b43_wldev *dev,
|
||||||
b43_radio_unlock(dev);
|
b43_radio_unlock(dev);
|
||||||
b43_phy_unlock(dev, phy_flags);
|
b43_phy_unlock(dev, phy_flags);
|
||||||
}
|
}
|
||||||
out_unlock:
|
|
||||||
spin_unlock_irqrestore(&dev->wl->irq_lock, flags);
|
|
||||||
|
|
||||||
return err;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* wl->irq_lock is locked */
|
/* wl->irq_lock is locked */
|
||||||
|
|
Loading…
Reference in a new issue