Commit 6b827529 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville

ath9k: use helper macro to kfree and nullify on ath9k_hw_rfdetach()

Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 39a21951
...@@ -266,32 +266,21 @@ ath9k_hw_set_rf_regs(struct ath_hw *ah, struct ath9k_channel *chan, ...@@ -266,32 +266,21 @@ ath9k_hw_set_rf_regs(struct ath_hw *ah, struct ath9k_channel *chan,
void void
ath9k_hw_rfdetach(struct ath_hw *ah) ath9k_hw_rfdetach(struct ath_hw *ah)
{ {
kfree(ah->analogBank0Data); #define ATH_FREE_BANK(bank) do { \
ah->analogBank0Data = NULL; kfree(bank); \
bank = NULL; \
kfree(ah->analogBank1Data); } while (0);
ah->analogBank1Data = NULL;
ATH_FREE_BANK(ah->analogBank0Data);
kfree(ah->analogBank2Data); ATH_FREE_BANK(ah->analogBank1Data);
ah->analogBank2Data = NULL; ATH_FREE_BANK(ah->analogBank2Data);
ATH_FREE_BANK(ah->analogBank3Data);
kfree(ah->analogBank3Data); ATH_FREE_BANK(ah->analogBank6Data);
ah->analogBank3Data = NULL; ATH_FREE_BANK(ah->analogBank6TPCData);
ATH_FREE_BANK(ah->analogBank7Data);
kfree(ah->analogBank6Data); ATH_FREE_BANK(ah->addac5416_21);
ah->analogBank6Data = NULL; ATH_FREE_BANK(ah->bank6Temp);
#undef ATH_FREE_BANK
kfree(ah->analogBank6TPCData);
ah->analogBank6TPCData = NULL;
kfree(ah->analogBank7Data);
ah->analogBank7Data = NULL;
kfree(ah->addac5416_21);
ah->addac5416_21 = NULL;
kfree(ah->bank6Temp);
ah->bank6Temp = NULL;
} }
bool ath9k_hw_init_rf(struct ath_hw *ah, int *status) bool ath9k_hw_init_rf(struct ath_hw *ah, int *status)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment