diff options
author | Sujith Manoharan <c_manoha@qca.qualcomm.com> | 2012-12-09 20:52:35 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-12-10 15:49:48 -0500 |
commit | 36d2943ba738a601e29cbd86fa6ab6ac838f3905 (patch) | |
tree | 414e8071ab9c893a76f9be58b0d5aeb2cf2c47e2 | |
parent | 19f7842240eb30b1fdf4eacdd444bc9f61f97382 (diff) |
ath9k_hw: Various trivial fixes for PAPRD
* Remove unneeded memset.
All the values in the PAPRD gain table are filled, so there
is no need to zero out the arrays.
* Use GFP_KERNEL in ar9003_paprd_create_curve
This is called from the PAPRD work, so the atomic variant
is not needed.
* Change return type of ar9003_paprd_setup_gain_table
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_paprd.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 2 |
2 files changed, 3 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c index 4945fdf61bac..b28565e80785 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c | |||
@@ -287,9 +287,6 @@ static void ar9003_paprd_get_gain_table(struct ath_hw *ah) | |||
287 | u32 reg = AR_PHY_TXGAIN_TABLE; | 287 | u32 reg = AR_PHY_TXGAIN_TABLE; |
288 | int i; | 288 | int i; |
289 | 289 | ||
290 | memset(entry, 0, sizeof(ah->paprd_gain_table_entries)); | ||
291 | memset(index, 0, sizeof(ah->paprd_gain_table_index)); | ||
292 | |||
293 | for (i = 0; i < PAPRD_GAIN_TABLE_ENTRIES; i++) { | 290 | for (i = 0; i < PAPRD_GAIN_TABLE_ENTRIES; i++) { |
294 | entry[i] = REG_READ(ah, reg); | 291 | entry[i] = REG_READ(ah, reg); |
295 | index[i] = (entry[i] >> 24) & 0xff; | 292 | index[i] = (entry[i] >> 24) & 0xff; |
@@ -788,7 +785,7 @@ void ar9003_paprd_populate_single_table(struct ath_hw *ah, | |||
788 | } | 785 | } |
789 | EXPORT_SYMBOL(ar9003_paprd_populate_single_table); | 786 | EXPORT_SYMBOL(ar9003_paprd_populate_single_table); |
790 | 787 | ||
791 | int ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain) | 788 | void ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain) |
792 | { | 789 | { |
793 | unsigned int i, desired_gain, gain_index; | 790 | unsigned int i, desired_gain, gain_index; |
794 | unsigned int train_power = ah->paprd_training_power; | 791 | unsigned int train_power = ah->paprd_training_power; |
@@ -806,8 +803,6 @@ int ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain) | |||
806 | 803 | ||
807 | REG_CLR_BIT(ah, AR_PHY_PAPRD_TRAINER_STAT1, | 804 | REG_CLR_BIT(ah, AR_PHY_PAPRD_TRAINER_STAT1, |
808 | AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE); | 805 | AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE); |
809 | |||
810 | return 0; | ||
811 | } | 806 | } |
812 | EXPORT_SYMBOL(ar9003_paprd_setup_gain_table); | 807 | EXPORT_SYMBOL(ar9003_paprd_setup_gain_table); |
813 | 808 | ||
@@ -919,7 +914,7 @@ int ar9003_paprd_create_curve(struct ath_hw *ah, | |||
919 | 914 | ||
920 | memset(caldata->pa_table[chain], 0, sizeof(caldata->pa_table[chain])); | 915 | memset(caldata->pa_table[chain], 0, sizeof(caldata->pa_table[chain])); |
921 | 916 | ||
922 | buf = kmalloc(2 * 48 * sizeof(u32), GFP_ATOMIC); | 917 | buf = kmalloc(2 * 48 * sizeof(u32), GFP_KERNEL); |
923 | if (!buf) | 918 | if (!buf) |
924 | return -ENOMEM; | 919 | return -ENOMEM; |
925 | 920 | ||
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 3636dabf03e1..fe87d0e67a1b 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -1058,7 +1058,7 @@ void ar9003_paprd_populate_single_table(struct ath_hw *ah, | |||
1058 | int chain); | 1058 | int chain); |
1059 | int ar9003_paprd_create_curve(struct ath_hw *ah, | 1059 | int ar9003_paprd_create_curve(struct ath_hw *ah, |
1060 | struct ath9k_hw_cal_data *caldata, int chain); | 1060 | struct ath9k_hw_cal_data *caldata, int chain); |
1061 | int ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain); | 1061 | void ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain); |
1062 | int ar9003_paprd_init_table(struct ath_hw *ah); | 1062 | int ar9003_paprd_init_table(struct ath_hw *ah); |
1063 | bool ar9003_paprd_is_done(struct ath_hw *ah); | 1063 | bool ar9003_paprd_is_done(struct ath_hw *ah); |
1064 | 1064 | ||