summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/phy.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-10-19 02:33:37 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-30 16:50:37 -0400
commit574d6b122d37549bc2817a4939d238f3d8b41da4 (patch)
tree85de91f82240ea923478b09281502508bc35952c /drivers/net/wireless/ath/ath9k/phy.c
parentb67b4397cfbfca8f5c4fff2a36e00d81ef6a28c2 (diff)
ath9k_hw: simplify rf attach and rename to ath9k_hw_rf_alloc_ext_banks()
ath9k_hw_rfattach() was just calling a helper and this helper was doing nothing for single-chip devices, and for non single-chip devices it is just allocating memory for banks to program the RF registers at a later time. Simplify this by having the hw initialization call the rf bank allocation directly for external radios. Also, propagate an -ENOMEM properly now upon failure. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/phy.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/phy.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/net/wireless/ath/ath9k/phy.c b/drivers/net/wireless/ath/ath9k/phy.c
index bd4fb076cb0..f3136b2dfb7 100644
--- a/drivers/net/wireless/ath/ath9k/phy.c
+++ b/drivers/net/wireless/ath/ath9k/phy.c
@@ -409,18 +409,16 @@ ath9k_hw_rf_free(struct ath_hw *ah)
}
/**
- * ath9k_hw_init_rf - initialize external radio structures
+ * ath9k_hw_rf_alloc_ext_banks - allocates banks for external radio programming
* @ah: atheros hardware structure
- * @status:
*
* Only required for older devices with external AR2133/AR5133 radios.
*/
-bool ath9k_hw_init_rf(struct ath_hw *ah, int *status)
+int ath9k_hw_rf_alloc_ext_banks(struct ath_hw *ah)
{
struct ath_common *common = ath9k_hw_common(ah);
- if (AR_SREV_9280_10_OR_LATER(ah))
- return true;
+ BUG_ON(AR_SREV_9280_10_OR_LATER(ah));
ah->analogBank0Data =
kzalloc((sizeof(u32) *
@@ -453,8 +451,7 @@ bool ath9k_hw_init_rf(struct ath_hw *ah, int *status)
|| ah->analogBank7Data == NULL) {
ath_print(common, ATH_DBG_FATAL,
"Cannot allocate RF banks\n");
- *status = -ENOMEM;
- return false;
+ return -ENOMEM;
}
ah->addac5416_21 =
@@ -464,8 +461,7 @@ bool ath9k_hw_init_rf(struct ath_hw *ah, int *status)
if (ah->addac5416_21 == NULL) {
ath_print(common, ATH_DBG_FATAL,
"Cannot allocate addac5416_21\n");
- *status = -ENOMEM;
- return false;
+ return -ENOMEM;
}
ah->bank6Temp =
@@ -474,11 +470,10 @@ bool ath9k_hw_init_rf(struct ath_hw *ah, int *status)
if (ah->bank6Temp == NULL) {
ath_print(common, ATH_DBG_FATAL,
"Cannot allocate bank6Temp\n");
- *status = -ENOMEM;
- return false;
+ return -ENOMEM;
}
- return true;
+ return 0;
}
/**