struct b43_led *led = container_of(led_dev, struct b43_led, led_dev);
struct b43_wl *wl = led->wl;
- /* The check for current_dev is only needed while unregistering,
- * so it is sequencial and does not race. But we must not dereference
- * current_dev here. */
- if (likely(wl->current_dev)) {
+ if (likely(!wl->leds.stop)) {
atomic_set(&led->state, brightness);
ieee80211_queue_work(wl->hw, &wl->leds.work);
}
break;
}
}
+
+ dev->wl->leds.stop = 0;
}
void b43_leds_exit(struct b43_wldev *dev)
* might have modified it. Restoring is important, so the networking
* stack can properly free resources. */
wl->hw->queues = wl->mac80211_initially_registered_queues;
- wl->current_dev = NULL;
+ wl->leds.stop = 1;
cancel_work_sync(&wl->leds.work);
ieee80211_unregister_hw(wl->hw);
}