Search Linux Wireless

[RFT 05/15] ath9k_hw: bail out early on ath9k_hw_init_rf()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We a huge branch for old hardware and nothing for newer
hardware. Instead of doing this just bail out early for
newer hardware.

This patch has no functional changes.

Signed-off-by: Luis R. Rodriguez <lrodriguez@xxxxxxxxxxx>
---
 drivers/net/wireless/ath/ath9k/phy.c |  109 +++++++++++++++++-----------------
 1 files changed, 55 insertions(+), 54 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/phy.c b/drivers/net/wireless/ath/ath9k/phy.c
index 9e51503..bd4fb07 100644
--- a/drivers/net/wireless/ath/ath9k/phy.c
+++ b/drivers/net/wireless/ath/ath9k/phy.c
@@ -419,62 +419,63 @@ bool ath9k_hw_init_rf(struct ath_hw *ah, int *status)
 {
 	struct ath_common *common = ath9k_hw_common(ah);
 
-	if (!AR_SREV_9280_10_OR_LATER(ah)) {
-		ah->analogBank0Data =
-		    kzalloc((sizeof(u32) *
-			     ah->iniBank0.ia_rows), GFP_KERNEL);
-		ah->analogBank1Data =
-		    kzalloc((sizeof(u32) *
-			     ah->iniBank1.ia_rows), GFP_KERNEL);
-		ah->analogBank2Data =
-		    kzalloc((sizeof(u32) *
-			     ah->iniBank2.ia_rows), GFP_KERNEL);
-		ah->analogBank3Data =
-		    kzalloc((sizeof(u32) *
-			     ah->iniBank3.ia_rows), GFP_KERNEL);
-		ah->analogBank6Data =
-		    kzalloc((sizeof(u32) *
-			     ah->iniBank6.ia_rows), GFP_KERNEL);
-		ah->analogBank6TPCData =
-		    kzalloc((sizeof(u32) *
-			     ah->iniBank6TPC.ia_rows), GFP_KERNEL);
-		ah->analogBank7Data =
-		    kzalloc((sizeof(u32) *
-			     ah->iniBank7.ia_rows), GFP_KERNEL);
-
-		if (ah->analogBank0Data == NULL
-		    || ah->analogBank1Data == NULL
-		    || ah->analogBank2Data == NULL
-		    || ah->analogBank3Data == NULL
-		    || ah->analogBank6Data == NULL
-		    || ah->analogBank6TPCData == NULL
-		    || ah->analogBank7Data == NULL) {
-			ath_print(common, ATH_DBG_FATAL,
-				  "Cannot allocate RF banks\n");
-			*status = -ENOMEM;
-			return false;
-		}
+	if (AR_SREV_9280_10_OR_LATER(ah))
+		return true;
 
-		ah->addac5416_21 =
-		    kzalloc((sizeof(u32) *
-			     ah->iniAddac.ia_rows *
-			     ah->iniAddac.ia_columns), GFP_KERNEL);
-		if (ah->addac5416_21 == NULL) {
-			ath_print(common, ATH_DBG_FATAL,
-				  "Cannot allocate addac5416_21\n");
-			*status = -ENOMEM;
-			return false;
-		}
+	ah->analogBank0Data =
+	    kzalloc((sizeof(u32) *
+		     ah->iniBank0.ia_rows), GFP_KERNEL);
+	ah->analogBank1Data =
+	    kzalloc((sizeof(u32) *
+		     ah->iniBank1.ia_rows), GFP_KERNEL);
+	ah->analogBank2Data =
+	    kzalloc((sizeof(u32) *
+		     ah->iniBank2.ia_rows), GFP_KERNEL);
+	ah->analogBank3Data =
+	    kzalloc((sizeof(u32) *
+		     ah->iniBank3.ia_rows), GFP_KERNEL);
+	ah->analogBank6Data =
+	    kzalloc((sizeof(u32) *
+		     ah->iniBank6.ia_rows), GFP_KERNEL);
+	ah->analogBank6TPCData =
+	    kzalloc((sizeof(u32) *
+		     ah->iniBank6TPC.ia_rows), GFP_KERNEL);
+	ah->analogBank7Data =
+	    kzalloc((sizeof(u32) *
+		     ah->iniBank7.ia_rows), GFP_KERNEL);
+
+	if (ah->analogBank0Data == NULL
+	    || ah->analogBank1Data == NULL
+	    || ah->analogBank2Data == NULL
+	    || ah->analogBank3Data == NULL
+	    || ah->analogBank6Data == NULL
+	    || ah->analogBank6TPCData == NULL
+	    || ah->analogBank7Data == NULL) {
+		ath_print(common, ATH_DBG_FATAL,
+			  "Cannot allocate RF banks\n");
+		*status = -ENOMEM;
+		return false;
+	}
 
-		ah->bank6Temp =
-		    kzalloc((sizeof(u32) *
-			     ah->iniBank6.ia_rows), GFP_KERNEL);
-		if (ah->bank6Temp == NULL) {
-			ath_print(common, ATH_DBG_FATAL,
-				  "Cannot allocate bank6Temp\n");
-			*status = -ENOMEM;
-			return false;
-		}
+	ah->addac5416_21 =
+	    kzalloc((sizeof(u32) *
+		     ah->iniAddac.ia_rows *
+		     ah->iniAddac.ia_columns), GFP_KERNEL);
+	if (ah->addac5416_21 == NULL) {
+		ath_print(common, ATH_DBG_FATAL,
+			  "Cannot allocate addac5416_21\n");
+		*status = -ENOMEM;
+		return false;
+	}
+
+	ah->bank6Temp =
+	    kzalloc((sizeof(u32) *
+		     ah->iniBank6.ia_rows), GFP_KERNEL);
+	if (ah->bank6Temp == NULL) {
+		ath_print(common, ATH_DBG_FATAL,
+			  "Cannot allocate bank6Temp\n");
+		*status = -ENOMEM;
+		return false;
 	}
 
 	return true;
-- 
1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux