summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/b43/leds.c
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2007-09-20 22:13:40 +0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-11 03:52:07 +0400
commit1a09404a2338163f181d170c7abdc2242b6c6f03 (patch)
tree090a31041c1e294a2586f12679a17a5329129272 /drivers/net/wireless/b43/leds.c
parentfb8e4444cc8c7719d9947e21a93e2e84bb1b36eb (diff)
downloadlinux-1a09404a2338163f181d170c7abdc2242b6c6f03.tar.xz
[B43]: Fix sparse warnings.
The remaining warning in phy.c will be fixed later. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/b43/leds.c')
-rw-r--r--drivers/net/wireless/b43/leds.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/b43/leds.c b/drivers/net/wireless/b43/leds.c
index 535f960412d7..85d965de5791 100644
--- a/drivers/net/wireless/b43/leds.c
+++ b/drivers/net/wireless/b43/leds.c
@@ -32,14 +32,13 @@
static void b43_led_changestate(struct b43_led *led)
{
struct b43_wldev *dev = led->dev;
- const int index = b43_led_index(led);
- const u16 mask = (1 << index);
+ const int index = led->index;
u16 ledctl;
B43_WARN_ON(!(index >= 0 && index < B43_NR_LEDS));
B43_WARN_ON(!led->blink_interval);
ledctl = b43_read16(dev, B43_MMIO_GPIO_CONTROL);
- ledctl = (ledctl & mask) ? (ledctl & ~mask) : (ledctl | mask);
+ ledctl ^= (1 << index);
b43_write16(dev, B43_MMIO_GPIO_CONTROL, ledctl);
}
@@ -70,7 +69,7 @@ static void b43_led_blink_start(struct b43_led *led, unsigned long interval)
static void b43_led_blink_stop(struct b43_led *led, int sync)
{
struct b43_wldev *dev = led->dev;
- const int index = b43_led_index(led);
+ const int index = led->index;
u16 ledctl;
if (!led->blink_interval)
@@ -139,6 +138,7 @@ int b43_leds_init(struct b43_wldev *dev)
for (i = 0; i < B43_NR_LEDS; i++) {
led = &(dev->leds[i]);
+ led->index = i;
led->dev = dev;
setup_timer(&led->blink_timer,
b43_led_blink, (unsigned long)led);