]> Pileus Git - ~andy/linux/blobdiff - drivers/net/wireless/ath/ath9k/ar9003_hw.c
ath9k_hw: dynamically choose the SERDES array for low power
[~andy/linux] / drivers / net / wireless / ath / ath9k / ar9003_hw.c
index 99bde5f96a83e3c483dc0da0e8002ec35d8b919b..064168909108005531e90e9ea657f51a43866794 100644 (file)
@@ -305,11 +305,15 @@ static void ar9003_hw_configpcipowersave(struct ath_hw *ah,
         */
        if (ah->config.pcieSerDesWrite) {
                unsigned int i;
+               struct ar5416IniArray *array;
 
-               for (i = 0; i < ah->iniPcieSerdesLowPower.ia_rows; i++) {
+               array = power_off ? &ah->iniPcieSerdes :
+                                   &ah->iniPcieSerdesLowPower;
+
+               for (i = 0; i < array->ia_rows; i++) {
                        REG_WRITE(ah,
-                                 INI_RA(&ah->iniPcieSerdesLowPower, i, 0),
-                                 INI_RA(&ah->iniPcieSerdesLowPower, i, 1));
+                                 INI_RA(array, i, 0),
+                                 INI_RA(array, i, 1));
                }
        }
 }