diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-08-03 15:24:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-04 16:44:31 -0400 |
commit | 6b827529058d6d479f31b281a9ec630f7b6841e1 (patch) | |
tree | d72a3b1a0e4b68eb304ec21034da9c4673a8c48a | |
parent | 39a21951efc99e040a7d66449f63910e439b97e9 (diff) |
ath9k: use helper macro to kfree and nullify on ath9k_hw_rfdetach()
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/phy.c | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/drivers/net/wireless/ath/ath9k/phy.c b/drivers/net/wireless/ath/ath9k/phy.c index 06fd057e467b..98b1b56d87c4 100644 --- a/drivers/net/wireless/ath/ath9k/phy.c +++ b/drivers/net/wireless/ath/ath9k/phy.c | |||
@@ -266,32 +266,21 @@ ath9k_hw_set_rf_regs(struct ath_hw *ah, struct ath9k_channel *chan, | |||
266 | void | 266 | void |
267 | ath9k_hw_rfdetach(struct ath_hw *ah) | 267 | ath9k_hw_rfdetach(struct ath_hw *ah) |
268 | { | 268 | { |
269 | kfree(ah->analogBank0Data); | 269 | #define ATH_FREE_BANK(bank) do { \ |
270 | ah->analogBank0Data = NULL; | 270 | kfree(bank); \ |
271 | 271 | bank = NULL; \ | |
272 | kfree(ah->analogBank1Data); | 272 | } while (0); |
273 | ah->analogBank1Data = NULL; | 273 | |
274 | 274 | ATH_FREE_BANK(ah->analogBank0Data); | |
275 | kfree(ah->analogBank2Data); | 275 | ATH_FREE_BANK(ah->analogBank1Data); |
276 | ah->analogBank2Data = NULL; | 276 | ATH_FREE_BANK(ah->analogBank2Data); |
277 | 277 | ATH_FREE_BANK(ah->analogBank3Data); | |
278 | kfree(ah->analogBank3Data); | 278 | ATH_FREE_BANK(ah->analogBank6Data); |
279 | ah->analogBank3Data = NULL; | 279 | ATH_FREE_BANK(ah->analogBank6TPCData); |
280 | 280 | ATH_FREE_BANK(ah->analogBank7Data); | |
281 | kfree(ah->analogBank6Data); | 281 | ATH_FREE_BANK(ah->addac5416_21); |
282 | ah->analogBank6Data = NULL; | 282 | ATH_FREE_BANK(ah->bank6Temp); |
283 | 283 | #undef ATH_FREE_BANK | |
284 | kfree(ah->analogBank6TPCData); | ||
285 | ah->analogBank6TPCData = NULL; | ||
286 | |||
287 | kfree(ah->analogBank7Data); | ||
288 | ah->analogBank7Data = NULL; | ||
289 | |||
290 | kfree(ah->addac5416_21); | ||
291 | ah->addac5416_21 = NULL; | ||
292 | |||
293 | kfree(ah->bank6Temp); | ||
294 | ah->bank6Temp = NULL; | ||
295 | } | 284 | } |
296 | 285 | ||
297 | bool ath9k_hw_init_rf(struct ath_hw *ah, int *status) | 286 | bool ath9k_hw_init_rf(struct ath_hw *ah, int *status) |