1 --- a/drivers/net/wireless/ath/ath9k/main.c
2 +++ b/drivers/net/wireless/ath/ath9k/main.c
3 @@ -1056,9 +1056,11 @@ static int ath9k_start(struct ieee80211_
7 - ath9k_hw_cfg_output(ah, ah->led_pin,
8 - AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
9 - ath9k_hw_set_gpio(ah, ah->led_pin, 0);
10 + if (ah->led_pin >= 0) {
11 + ath9k_hw_cfg_output(ah, ah->led_pin,
12 + AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
13 + ath9k_hw_set_gpio(ah, ah->led_pin, 0);
17 * Reset key cache to sane defaults (all entries cleared) instead of
18 @@ -1209,8 +1211,10 @@ static void ath9k_stop(struct ieee80211_
20 spin_lock_bh(&sc->sc_pcu_lock);
22 - ath9k_hw_set_gpio(ah, ah->led_pin, 1);
23 - ath9k_hw_cfg_gpio_input(ah, ah->led_pin);
24 + if (ah->led_pin >= 0) {
25 + ath9k_hw_set_gpio(ah, ah->led_pin, 1);
26 + ath9k_hw_cfg_gpio_input(ah, ah->led_pin);
29 ath_prepare_reset(sc, false, true);