]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
ath9k: merge common ->config_pci_powersave() checks
authorStanislaw Gruszka <sgruszka@redhat.com>
Fri, 5 Aug 2011 11:10:33 +0000 (13:10 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 22 Aug 2011 18:45:57 +0000 (14:45 -0400)
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>
drivers/net/wireless/ath/ath9k/ar9002_hw.c
drivers/net/wireless/ath/ath9k/ar9003_hw.c
drivers/net/wireless/ath/ath9k/hw-ops.h

index 70a18d14db19cb1d8b717c2d080a29956a79df83..b54ab78fb092231f16dc8f33039bad8f6f1f0435 100644 (file)
@@ -308,9 +308,6 @@ static void ar9002_hw_configpcipowersave(struct ath_hw *ah,
        u8 i;
        u32 val;
 
-       if (ah->is_pciexpress != true || ah->aspm_enabled != true)
-               return;
-
        /* Nothing to do on restore for 11N */
        if (!power_off /* !restore */) {
                if (AR_SREV_9280_20_OR_LATER(ah)) {
index e3d58bdb521527a136f6aca6d764d721b335f5a6..9cf5d13529c2d7813ff31daa1fb0cdb2e51d9fc5 100644 (file)
@@ -518,9 +518,6 @@ static void ar9003_hw_init_mode_gain_regs(struct ath_hw *ah)
 static void ar9003_hw_configpcipowersave(struct ath_hw *ah,
                                         bool power_off)
 {
-       if (ah->is_pciexpress != true || ah->aspm_enabled != true)
-               return;
-
        /* Nothing to do on restore for 11N */
        if (!power_off /* !restore */) {
                /* set bit 19 to allow forcing of pcie core into L1 state */
index 8c123857c9d700933c1e96d4f0e1b6ef96658247..dd9003ee123bfbe6701eedd519cdb749c643960a 100644 (file)
@@ -24,6 +24,9 @@
 static inline void ath9k_hw_configpcipowersave(struct ath_hw *ah,
                                               bool power_off)
 {
+       if (ah->aspm_enabled != true)
+               return;
+
        ath9k_hw_ops(ah)->config_pci_powersave(ah, power_off);
 }