]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ath9k_hw: move init config and default after chip is up
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Thu, 15 Apr 2010 21:38:20 +0000 (17:38 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 16 Apr 2010 19:43:20 +0000 (15:43 -0400)
This allows us to add SREV checks on these helpers.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/hw.c

index f057d1ad9290d2b12c67d45eefcdff9e76dd7346..65c3b9e5d9c3e026db869cc785db031a366bbf04 100644 (file)
@@ -409,8 +409,6 @@ static void ath9k_hw_init_defaults(struct ath_hw *ah)
        ah->hw_version.subvendorid = 0;
 
        ah->ah_flags = 0;
-       if (ah->hw_version.devid == AR5416_AR9100_DEVID)
-               ah->hw_version.macVersion = AR_SREV_VERSION_9100;
        if (!AR_SREV_9100(ah))
                ah->ah_flags = AH_USE_EEPROM;
 
@@ -873,8 +871,8 @@ static int __ath9k_hw_init(struct ath_hw *ah)
        struct ath_common *common = ath9k_hw_common(ah);
        int r = 0;
 
-       ath9k_hw_init_defaults(ah);
-       ath9k_hw_init_config(ah);
+       if (ah->hw_version.devid == AR5416_AR9100_DEVID)
+               ah->hw_version.macVersion = AR_SREV_VERSION_9100;
 
        if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_POWER_ON)) {
                ath_print(common, ATH_DBG_FATAL,
@@ -882,6 +880,9 @@ static int __ath9k_hw_init(struct ath_hw *ah)
                return -EIO;
        }
 
+       ath9k_hw_init_defaults(ah);
+       ath9k_hw_init_config(ah);
+
        ath9k_hw_attach_ops(ah);
 
        if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) {