diff mbox

[4/5] ath9k_hw: dynamically choose the SERDES array for low power

Message ID 1277159931-7797-5-git-send-email-lrodriguez@atheros.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Luis Rodriguez June 21, 2010, 10:38 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_hw.c b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
index 99bde5f..0641689 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
@@ -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));
 		}
 	}
 }