Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelv...
[deliverable/linux.git] / drivers / net / wireless / b43 / leds.c
index 76f4c7bad8b83e52b30000ccc62f86a77113e45b..c8b317094c31b489dfbb9091bb7c648f3060d927 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "b43.h"
 #include "leds.h"
+#include "rfkill.h"
 
 
 static void b43_led_turn_on(struct b43_wldev *dev, u8 led_index,
@@ -87,7 +88,7 @@ static void b43_led_brightness_set(struct led_classdev *led_dev,
 }
 
 static int b43_register_led(struct b43_wldev *dev, struct b43_led *led,
-                           const char *name, char *default_trigger,
+                           const char *name, const char *default_trigger,
                            u8 led_index, bool activelow)
 {
        int err;
@@ -164,10 +165,10 @@ static void b43_map_led(struct b43_wldev *dev,
                snprintf(name, sizeof(name),
                         "b43-%s::radio", wiphy_name(hw->wiphy));
                b43_register_led(dev, &dev->led_radio, name,
-                                b43_rfkill_led_name(dev),
+                                ieee80211_get_radio_led_name(hw),
                                 led_index, activelow);
-               /* Sync the RF-kill LED state with the switch state. */
-               if (dev->radio_hw_enable)
+               /* Sync the RF-kill LED state with radio and switch states. */
+               if (dev->phy.radio_on && b43_is_hw_radio_enabled(dev))
                        b43_led_turn_on(dev, led_index, activelow);
                break;
        case B43_LED_WEIRD:
This page took 0.029359 seconds and 5 git commands to generate.