| .. | .. |
|---|
| 89 | 89 | |
|---|
| 90 | 90 | void ath5k_led_enable(struct ath5k_hw *ah) |
|---|
| 91 | 91 | { |
|---|
| 92 | | - if (test_bit(ATH_STAT_LEDSOFT, ah->status)) { |
|---|
| 92 | + if (IS_ENABLED(CONFIG_MAC80211_LEDS) && |
|---|
| 93 | + test_bit(ATH_STAT_LEDSOFT, ah->status)) { |
|---|
| 93 | 94 | ath5k_hw_set_gpio_output(ah, ah->led_pin); |
|---|
| 94 | 95 | ath5k_led_off(ah); |
|---|
| 95 | 96 | } |
|---|
| .. | .. |
|---|
| 104 | 105 | |
|---|
| 105 | 106 | void ath5k_led_off(struct ath5k_hw *ah) |
|---|
| 106 | 107 | { |
|---|
| 107 | | - if (!test_bit(ATH_STAT_LEDSOFT, ah->status)) |
|---|
| 108 | + if (!IS_ENABLED(CONFIG_MAC80211_LEDS) || |
|---|
| 109 | + !test_bit(ATH_STAT_LEDSOFT, ah->status)) |
|---|
| 108 | 110 | return; |
|---|
| 109 | 111 | ath5k_hw_set_gpio(ah, ah->led_pin, !ah->led_on); |
|---|
| 110 | 112 | } |
|---|
| .. | .. |
|---|
| 146 | 148 | static void |
|---|
| 147 | 149 | ath5k_unregister_led(struct ath5k_led *led) |
|---|
| 148 | 150 | { |
|---|
| 149 | | - if (!led->ah) |
|---|
| 151 | + if (!IS_ENABLED(CONFIG_MAC80211_LEDS) || !led->ah) |
|---|
| 150 | 152 | return; |
|---|
| 151 | 153 | led_classdev_unregister(&led->led_dev); |
|---|
| 152 | 154 | ath5k_led_off(led->ah); |
|---|
| .. | .. |
|---|
| 169 | 171 | char name[ATH5K_LED_MAX_NAME_LEN + 1]; |
|---|
| 170 | 172 | const struct pci_device_id *match; |
|---|
| 171 | 173 | |
|---|
| 172 | | - if (!ah->pdev) |
|---|
| 174 | + if (!IS_ENABLED(CONFIG_MAC80211_LEDS) || !ah->pdev) |
|---|
| 173 | 175 | return 0; |
|---|
| 174 | 176 | |
|---|
| 175 | 177 | #ifdef CONFIG_ATH5K_AHB |
|---|