===================================================================
@@ -107,6 +107,9 @@ static void rtl8187_led_brightness_set(s
struct ieee80211_hw *hw = led->dev;
struct rtl8187_priv *priv = hw->priv;
+ /* detect shutting down */
+ if (priv->leds_off)
+ return;
if (brightness == LED_OFF) {
ieee80211_queue_delayed_work(hw, &priv->led_off, 0);
/* The LED is off for 1/20 sec so that it just blinks. */
@@ -179,6 +182,7 @@ void rtl8187_leds_init(struct ieee80211_
ledpin = LED_PIN_GPIO0;
}
+ priv->leds_off = false;
INIT_DELAYED_WORK(&priv->led_on, led_turn_on);
INIT_DELAYED_WORK(&priv->led_off, led_turn_off);
@@ -210,6 +214,7 @@ void rtl8187_leds_exit(struct ieee80211_
/* turn the LED off before exiting */
ieee80211_queue_delayed_work(dev, &priv->led_off, 0);
+ priv->leds_off = true;
cancel_delayed_work_sync(&priv->led_off);
cancel_delayed_work_sync(&priv->led_on);
rtl8187_unregister_led(&priv->led_rx);
===================================================================
@@ -134,6 +134,7 @@ struct rtl8187_priv {
__le32 bits32;
} *io_dmabuf;
bool rfkill_off;
+ bool leds_off;
};
void rtl8187_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data);