aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43legacy/radio.c
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2008-01-09 14:15:31 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:10:42 -0500
commitbfe6a50156ab0c33729378fae7038bce3c6c5184 (patch)
tree4d29fdaa77eef7772eadab31033227e49e67c911 /drivers/net/wireless/b43legacy/radio.c
parenta8bdf29c6cd117644d27677962fe832b33036c77 (diff)
b43legacy: Remove the PHY spinlock
This fixes a sparse warning about weird locking. The spinlock is not needed, so simply remove it. This also adds some sanity checks to the PHY and radio locking to protect against recursive locking. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43legacy/radio.c')
-rw-r--r--drivers/net/wireless/b43legacy/radio.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/wireless/b43legacy/radio.c b/drivers/net/wireless/b43legacy/radio.c
index 1a72eb0f8f66..318a270cf9b4 100644
--- a/drivers/net/wireless/b43legacy/radio.c
+++ b/drivers/net/wireless/b43legacy/radio.c
@@ -92,6 +92,7 @@ void b43legacy_radio_lock(struct b43legacy_wldev *dev)
92 u32 status; 92 u32 status;
93 93
94 status = b43legacy_read32(dev, B43legacy_MMIO_STATUS_BITFIELD); 94 status = b43legacy_read32(dev, B43legacy_MMIO_STATUS_BITFIELD);
95 B43legacy_WARN_ON(status & B43legacy_SBF_RADIOREG_LOCK);
95 status |= B43legacy_SBF_RADIOREG_LOCK; 96 status |= B43legacy_SBF_RADIOREG_LOCK;
96 b43legacy_write32(dev, B43legacy_MMIO_STATUS_BITFIELD, status); 97 b43legacy_write32(dev, B43legacy_MMIO_STATUS_BITFIELD, status);
97 mmiowb(); 98 mmiowb();
@@ -104,6 +105,7 @@ void b43legacy_radio_unlock(struct b43legacy_wldev *dev)
104 105
105 b43legacy_read16(dev, B43legacy_MMIO_PHY_VER); /* dummy read */ 106 b43legacy_read16(dev, B43legacy_MMIO_PHY_VER); /* dummy read */
106 status = b43legacy_read32(dev, B43legacy_MMIO_STATUS_BITFIELD); 107 status = b43legacy_read32(dev, B43legacy_MMIO_STATUS_BITFIELD);
108 B43legacy_WARN_ON(!(status & B43legacy_SBF_RADIOREG_LOCK));
107 status &= ~B43legacy_SBF_RADIOREG_LOCK; 109 status &= ~B43legacy_SBF_RADIOREG_LOCK;
108 b43legacy_write32(dev, B43legacy_MMIO_STATUS_BITFIELD, status); 110 b43legacy_write32(dev, B43legacy_MMIO_STATUS_BITFIELD, status);
109 mmiowb(); 111 mmiowb();
@@ -284,12 +286,11 @@ u8 b43legacy_radio_aci_scan(struct b43legacy_wldev *dev)
284 unsigned int j; 286 unsigned int j;
285 unsigned int start; 287 unsigned int start;
286 unsigned int end; 288 unsigned int end;
287 unsigned long phylock_flags;
288 289
289 if (!((phy->type == B43legacy_PHYTYPE_G) && (phy->rev > 0))) 290 if (!((phy->type == B43legacy_PHYTYPE_G) && (phy->rev > 0)))
290 return 0; 291 return 0;
291 292
292 b43legacy_phy_lock(dev, phylock_flags); 293 b43legacy_phy_lock(dev);
293 b43legacy_radio_lock(dev); 294 b43legacy_radio_lock(dev);
294 b43legacy_phy_write(dev, 0x0802, 295 b43legacy_phy_write(dev, 0x0802,
295 b43legacy_phy_read(dev, 0x0802) & 0xFFFC); 296 b43legacy_phy_read(dev, 0x0802) & 0xFFFC);
@@ -323,7 +324,7 @@ u8 b43legacy_radio_aci_scan(struct b43legacy_wldev *dev)
323 ret[j] = 1; 324 ret[j] = 1;
324 } 325 }
325 b43legacy_radio_unlock(dev); 326 b43legacy_radio_unlock(dev);
326 b43legacy_phy_unlock(dev, phylock_flags); 327 b43legacy_phy_unlock(dev);
327 328
328 return ret[channel - 1]; 329 return ret[channel - 1];
329} 330}