diff options
Diffstat (limited to 'drivers/net/wireless/ath9k/regd.c')
-rw-r--r-- | drivers/net/wireless/ath9k/regd.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath9k/regd.c b/drivers/net/wireless/ath9k/regd.c index 0c632fff8ada..99994626081d 100644 --- a/drivers/net/wireless/ath9k/regd.c +++ b/drivers/net/wireless/ath9k/regd.c | |||
@@ -371,11 +371,8 @@ ath9k_regd_find_country_by_rd(int regdmn) | |||
371 | } | 371 | } |
372 | 372 | ||
373 | /* Returns the map of the EEPROM set RD to a country code */ | 373 | /* Returns the map of the EEPROM set RD to a country code */ |
374 | static u16 ath9k_regd_get_default_country(struct ath_hw *ah) | 374 | static u16 ath9k_regd_get_default_country(u16 rd) |
375 | { | 375 | { |
376 | u16 rd; | ||
377 | |||
378 | rd = ath9k_regd_get_eepromRD(ah); | ||
379 | if (rd & COUNTRY_ERD_FLAG) { | 376 | if (rd & COUNTRY_ERD_FLAG) { |
380 | struct country_code_to_enum_rd *country = NULL; | 377 | struct country_code_to_enum_rd *country = NULL; |
381 | u16 cc = rd & ~COUNTRY_ERD_FLAG; | 378 | u16 cc = rd & ~COUNTRY_ERD_FLAG; |
@@ -405,7 +402,7 @@ ath9k_get_regpair(int regdmn) | |||
405 | int ath9k_regd_init(struct ath_hw *ah) | 402 | int ath9k_regd_init(struct ath_hw *ah) |
406 | { | 403 | { |
407 | struct country_code_to_enum_rd *country = NULL; | 404 | struct country_code_to_enum_rd *country = NULL; |
408 | int regdmn; | 405 | u16 regdmn; |
409 | 406 | ||
410 | if (!ath9k_regd_is_eeprom_valid(ah)) { | 407 | if (!ath9k_regd_is_eeprom_valid(ah)) { |
411 | DPRINTF(ah->ah_sc, ATH_DBG_REGULATORY, | 408 | DPRINTF(ah->ah_sc, ATH_DBG_REGULATORY, |
@@ -413,14 +410,14 @@ int ath9k_regd_init(struct ath_hw *ah) | |||
413 | return -EINVAL; | 410 | return -EINVAL; |
414 | } | 411 | } |
415 | 412 | ||
416 | ah->regulatory.country_code = ath9k_regd_get_default_country(ah); | 413 | regdmn = ath9k_regd_get_eepromRD(ah); |
414 | ah->regulatory.country_code = ath9k_regd_get_default_country(regdmn); | ||
417 | 415 | ||
418 | if (ah->regulatory.country_code == CTRY_DEFAULT && | 416 | if (ah->regulatory.country_code == CTRY_DEFAULT && |
419 | ath9k_regd_get_eepromRD(ah) == CTRY_DEFAULT) | 417 | regdmn == CTRY_DEFAULT) |
420 | ah->regulatory.country_code = CTRY_UNITED_STATES; | 418 | ah->regulatory.country_code = CTRY_UNITED_STATES; |
421 | 419 | ||
422 | if (ah->regulatory.country_code == CTRY_DEFAULT) { | 420 | if (ah->regulatory.country_code == CTRY_DEFAULT) { |
423 | regdmn = ath9k_regd_get_eepromRD(ah); | ||
424 | country = NULL; | 421 | country = NULL; |
425 | } else { | 422 | } else { |
426 | country = ath9k_regd_find_country(ah->regulatory.country_code); | 423 | country = ath9k_regd_find_country(ah->regulatory.country_code); |