Commit cbdec975 authored by Gabor Juhos's avatar Gabor Juhos Committed by John W. Linville

ath9k: get rid of unnecessary setpower calls

We are using setpower routines regardless of the current power mode.
Don't bother the hardware, if it is not necessary.

Changes-licensed-under: ISC
Signed-off-by: default avatarGabor Juhos <juhosg@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 96148326
...@@ -478,6 +478,8 @@ static struct ath_hw *ath9k_hw_newstate(u16 devid, struct ath_softc *sc, ...@@ -478,6 +478,8 @@ static struct ath_hw *ath9k_hw_newstate(u16 devid, struct ath_softc *sc,
ah->gbeacon_rate = 0; ah->gbeacon_rate = 0;
ah->power_mode = ATH9K_PM_UNDEFINED;
return ah; return ah;
} }
...@@ -2819,6 +2821,9 @@ static bool ath9k_hw_setpower_nolock(struct ath_hw *ah, ...@@ -2819,6 +2821,9 @@ static bool ath9k_hw_setpower_nolock(struct ath_hw *ah,
"UNDEFINED" "UNDEFINED"
}; };
if (ah->power_mode == mode)
return status;
DPRINTF(ah->ah_sc, ATH_DBG_RESET, "%s -> %s\n", DPRINTF(ah->ah_sc, ATH_DBG_RESET, "%s -> %s\n",
modes[ah->power_mode], modes[mode]); modes[ah->power_mode], modes[mode]);
...@@ -2863,7 +2868,6 @@ void ath9k_ps_wakeup(struct ath_softc *sc) ...@@ -2863,7 +2868,6 @@ void ath9k_ps_wakeup(struct ath_softc *sc)
if (++sc->ps_usecount != 1) if (++sc->ps_usecount != 1)
goto unlock; goto unlock;
if (sc->sc_ah->power_mode != ATH9K_PM_AWAKE)
ath9k_hw_setpower_nolock(sc->sc_ah, ATH9K_PM_AWAKE); ath9k_hw_setpower_nolock(sc->sc_ah, ATH9K_PM_AWAKE);
unlock: unlock:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment