diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2011-08-05 07:10:33 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-22 14:45:57 -0400 |
commit | 3b9cf1be8c4440ae0dd6809bcf3ab6e0e6c54573 (patch) | |
tree | b5b6b29b4c3db5db99f513a683ec8bae8a43bbf3 /drivers | |
parent | 84c87dc86eaf5c3f70d6c85fac832b277b1f71c7 (diff) |
ath9k: merge common ->config_pci_powersave() checks
Move common checks into wrapper function. Since ASPM can be only enabled
on PCIe devices ->is_pciexpress check is unneeded.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9002_hw.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_hw.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw-ops.h | 3 |
3 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_hw.c b/drivers/net/wireless/ath/ath9k/ar9002_hw.c index 70a18d14db19..b54ab78fb092 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c +++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c | |||
@@ -308,9 +308,6 @@ static void ar9002_hw_configpcipowersave(struct ath_hw *ah, | |||
308 | u8 i; | 308 | u8 i; |
309 | u32 val; | 309 | u32 val; |
310 | 310 | ||
311 | if (ah->is_pciexpress != true || ah->aspm_enabled != true) | ||
312 | return; | ||
313 | |||
314 | /* Nothing to do on restore for 11N */ | 311 | /* Nothing to do on restore for 11N */ |
315 | if (!power_off /* !restore */) { | 312 | if (!power_off /* !restore */) { |
316 | if (AR_SREV_9280_20_OR_LATER(ah)) { | 313 | if (AR_SREV_9280_20_OR_LATER(ah)) { |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_hw.c b/drivers/net/wireless/ath/ath9k/ar9003_hw.c index e3d58bdb5215..9cf5d13529c2 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c | |||
@@ -518,9 +518,6 @@ static void ar9003_hw_init_mode_gain_regs(struct ath_hw *ah) | |||
518 | static void ar9003_hw_configpcipowersave(struct ath_hw *ah, | 518 | static void ar9003_hw_configpcipowersave(struct ath_hw *ah, |
519 | bool power_off) | 519 | bool power_off) |
520 | { | 520 | { |
521 | if (ah->is_pciexpress != true || ah->aspm_enabled != true) | ||
522 | return; | ||
523 | |||
524 | /* Nothing to do on restore for 11N */ | 521 | /* Nothing to do on restore for 11N */ |
525 | if (!power_off /* !restore */) { | 522 | if (!power_off /* !restore */) { |
526 | /* set bit 19 to allow forcing of pcie core into L1 state */ | 523 | /* set bit 19 to allow forcing of pcie core into L1 state */ |
diff --git a/drivers/net/wireless/ath/ath9k/hw-ops.h b/drivers/net/wireless/ath/ath9k/hw-ops.h index 8c123857c9d7..dd9003ee123b 100644 --- a/drivers/net/wireless/ath/ath9k/hw-ops.h +++ b/drivers/net/wireless/ath/ath9k/hw-ops.h | |||
@@ -24,6 +24,9 @@ | |||
24 | static inline void ath9k_hw_configpcipowersave(struct ath_hw *ah, | 24 | static inline void ath9k_hw_configpcipowersave(struct ath_hw *ah, |
25 | bool power_off) | 25 | bool power_off) |
26 | { | 26 | { |
27 | if (ah->aspm_enabled != true) | ||
28 | return; | ||
29 | |||
27 | ath9k_hw_ops(ah)->config_pci_powersave(ah, power_off); | 30 | ath9k_hw_ops(ah)->config_pci_powersave(ah, power_off); |
28 | } | 31 | } |
29 | 32 | ||