diff options
author | Lucas Stach <dev@lynxeye.de> | 2016-06-03 23:04:03 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2016-06-16 18:14:46 +0300 |
commit | 508f1222ba4e14e0737a3a1b39aed9e3e8a21fc7 (patch) | |
tree | 01fa572c372332813269de0e2e457a6a19e5694a /drivers/net/wireless/broadcom/b43 | |
parent | 035ddbc59f542453491356dbcb4b8c2d548acf43 (diff) | |
download | linux-508f1222ba4e14e0737a3a1b39aed9e3e8a21fc7.tar.bz2 |
b43: only hardcode LED behavior if SPROM doesn't encode any
Only hardcode the LED behavior if the SROM doesn't provide any for all
LEDs of the card. This avoids instantiating LED triggers for unconnected
LEDs, while (hopefully) keeping things working for old cards with a
blank SROM.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/broadcom/b43')
-rw-r--r-- | drivers/net/wireless/broadcom/b43/leds.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/wireless/broadcom/b43/leds.c b/drivers/net/wireless/broadcom/b43/leds.c index d79ab2a227e1..cb987c2ecc6b 100644 --- a/drivers/net/wireless/broadcom/b43/leds.c +++ b/drivers/net/wireless/broadcom/b43/leds.c @@ -222,7 +222,7 @@ static void b43_led_get_sprominfo(struct b43_wldev *dev, sprom[2] = dev->dev->bus_sprom->gpio2; sprom[3] = dev->dev->bus_sprom->gpio3; - if (sprom[led_index] == 0xFF) { + if ((sprom[0] & sprom[1] & sprom[2] & sprom[3]) == 0xff) { /* There is no LED information in the SPROM * for this LED. Hardcode it here. */ *activelow = false; @@ -250,7 +250,11 @@ static void b43_led_get_sprominfo(struct b43_wldev *dev, return; } } else { - *behaviour = sprom[led_index] & B43_LED_BEHAVIOUR; + /* keep LED disabled if no mapping is defined */ + if (sprom[led_index] == 0xff) + *behaviour = B43_LED_OFF; + else + *behaviour = sprom[led_index] & B43_LED_BEHAVIOUR; *activelow = !!(sprom[led_index] & B43_LED_ACTIVELOW); } } |