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: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
 
        ah->gbeacon_rate = 0;
 
+       ah->power_mode = ATH9K_PM_UNDEFINED;
+
        return ah;
 }
 
                "UNDEFINED"
        };
 
+       if (ah->power_mode == mode)
+               return status;
+
        DPRINTF(ah->ah_sc, ATH_DBG_RESET, "%s -> %s\n",
                modes[ah->power_mode], modes[mode]);
 
        if (++sc->ps_usecount != 1)
                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:
        spin_unlock_irqrestore(&sc->sc_pm_lock, flags);