diff options
Diffstat (limited to 'sys/dev/ath/ath_hal/ar5210/ar5210_power.c')
-rw-r--r-- | sys/dev/ath/ath_hal/ar5210/ar5210_power.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/dev/ath/ath_hal/ar5210/ar5210_power.c b/sys/dev/ath/ath_hal/ar5210/ar5210_power.c index ec5e75d..1c6909b 100644 --- a/sys/dev/ath/ath_hal/ar5210/ar5210_power.c +++ b/sys/dev/ath/ath_hal/ar5210/ar5210_power.c @@ -93,6 +93,7 @@ ar5210SetPowerModeSleep(struct ath_hal *ah, int setChip) HAL_BOOL ar5210SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode, int setChip) { + struct ath_hal_5210 *ahp = AH5210(ah); #ifdef AH_DEBUG static const char* modes[] = { "AWAKE", @@ -104,30 +105,25 @@ ar5210SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode, int setChip) int status = AH_TRUE; HALDEBUG(ah, HAL_DEBUG_POWER, "%s: %s -> %s (%s)\n", __func__, - modes[ah->ah_powerMode], modes[mode], + modes[ahp->ah_powerMode], modes[mode], setChip ? "set chip " : ""); switch (mode) { case HAL_PM_AWAKE: - if (setChip) - ah->ah_powerMode = mode; status = ar5210SetPowerModeAwake(ah, setChip); break; case HAL_PM_FULL_SLEEP: ar5210SetPowerModeSleep(ah, setChip); - if (setChip) - ah->ah_powerMode = mode; break; case HAL_PM_NETWORK_SLEEP: ar5210SetPowerModeAuto(ah, setChip); - if (setChip) - ah->ah_powerMode = mode; break; default: HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unknown power mode %u\n", __func__, mode); return AH_FALSE; } - return status; + ahp->ah_powerMode = mode; + return status; } HAL_POWER_MODE |