ath9k: replace eeprom_param EEP_MINOR_REV with get_eeprom_rev
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Mon, 5 Dec 2016 11:27:34 +0000 (13:27 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 15 Dec 2016 08:26:27 +0000 (10:26 +0200)
get_eeprom(ah, EEP_MINOR_REV) and get_eeprom_rev(ah) are both doing the
same thing: returning the EEPROM revision (12 lowest bits). Make the
code consistent by using get_eeprom_rev(ah) everywhere.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath9k/ar5008_phy.c
drivers/net/wireless/ath/ath9k/ar9002_hw.c
drivers/net/wireless/ath/ath9k/eeprom.h
drivers/net/wireless/ath/ath9k/eeprom_4k.c
drivers/net/wireless/ath/ath9k/eeprom_9287.c
drivers/net/wireless/ath/ath9k/eeprom_def.c

index 8eea8d22e72e5a4c9a43ccd2d3494614562a7a4f..7922550c2159bbd6269aae15abbab79df4d99017 100644 (file)
@@ -524,7 +524,7 @@ static bool ar5008_hw_set_rf_regs(struct ath_hw *ah,
                return true;
 
        /* Setup rf parameters */
-       eepMinorRev = ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV);
+       eepMinorRev = ah->eep_ops->get_eeprom_rev(ah);
 
        for (i = 0; i < ah->iniBank6.ia_rows; i++)
                ah->analogBank6Data[i] = INI_RA(&ah->iniBank6, i, modesIndex);
index d480d2f3e18588843696bc3801d6a821ffbefee4..ae68f674829b1943e7ec24a6c6e351c297c392aa 100644 (file)
@@ -108,8 +108,7 @@ static void ar9280_20_hw_init_rxgain_ini(struct ath_hw *ah)
 {
        u32 rxgain_type;
 
-       if (ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV) >=
-           AR5416_EEP_MINOR_VER_17) {
+       if (ah->eep_ops->get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_17) {
                rxgain_type = ah->eep_ops->get_eeprom(ah, EEP_RXGAIN_TYPE);
 
                if (rxgain_type == AR5416_EEP_RXGAIN_13DB_BACKOFF)
@@ -129,8 +128,7 @@ static void ar9280_20_hw_init_rxgain_ini(struct ath_hw *ah)
 
 static void ar9280_20_hw_init_txgain_ini(struct ath_hw *ah, u32 txgain_type)
 {
-       if (ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV) >=
-           AR5416_EEP_MINOR_VER_19) {
+       if (ah->eep_ops->get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_19) {
                if (txgain_type == AR5416_EEP_TXGAIN_HIGH_POWER)
                        INIT_INI_ARRAY(&ah->iniModesTxGain,
                                       ar9280Modes_high_power_tx_gain_9280_2);
index 408cfa79758951f185b19e78689863d0cc3f2fcb..8ef8090d0c9c02b847b66d2f397d617ad56b7afc 100644 (file)
@@ -230,7 +230,6 @@ enum eeprom_param {
        EEP_DB_5,
        EEP_OB_2,
        EEP_DB_2,
-       EEP_MINOR_REV,
        EEP_TX_MASK,
        EEP_RX_MASK,
        EEP_FSTCLK_5G,
index 7cd9c64d9cbd4cd473975074e2234243a9eb828d..d4668712f866e9446496b13088c6bd2f5d49ac68 100644 (file)
@@ -254,9 +254,6 @@ static u32 ath9k_hw_4k_get_eeprom(struct ath_hw *ah,
        struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k;
        struct modal_eep_4k_header *pModal = &eep->modalHeader;
        struct base_eep_header_4k *pBase = &eep->baseEepHeader;
-       u16 ver_minor;
-
-       ver_minor = pBase->version & AR5416_EEP_VER_MINOR_MASK;
 
        switch (param) {
        case EEP_NFTHRESH_2:
@@ -279,8 +276,6 @@ static u32 ath9k_hw_4k_get_eeprom(struct ath_hw *ah,
                return pModal->ob_0;
        case EEP_DB_2:
                return pModal->db1_1;
-       case EEP_MINOR_REV:
-               return ver_minor;
        case EEP_TX_MASK:
                return pBase->txMask;
        case EEP_RX_MASK:
index e1ba9bc0afb853348671ec03febc75e4bf08f64d..7f85bd1435b294e316957d1f7928c5777a99fe81 100644 (file)
@@ -250,9 +250,7 @@ static u32 ath9k_hw_ar9287_get_eeprom(struct ath_hw *ah,
        struct ar9287_eeprom *eep = &ah->eeprom.map9287;
        struct modal_eep_ar9287_header *pModal = &eep->modalHeader;
        struct base_eep_ar9287_header *pBase = &eep->baseEepHeader;
-       u16 ver_minor;
-
-       ver_minor = pBase->version & AR9287_EEP_VER_MINOR_MASK;
+       u16 ver_minor = ath9k_hw_ar9287_get_eeprom_rev(ah);
 
        switch (param) {
        case EEP_NFTHRESH_2:
@@ -271,8 +269,6 @@ static u32 ath9k_hw_ar9287_get_eeprom(struct ath_hw *ah,
                return pBase->opCapFlags;
        case EEP_RF_SILENT:
                return pBase->rfSilent;
-       case EEP_MINOR_REV:
-               return ver_minor;
        case EEP_TX_MASK:
                return pBase->txMask;
        case EEP_RX_MASK:
index 087bdb7c10d6aa47d79ade004c03371c0c9f552c..e9af4a50234e169235f3898d955e89a4b891f936 100644 (file)
@@ -380,8 +380,6 @@ static u32 ath9k_hw_def_get_eeprom(struct ath_hw *ah,
                return pModal[1].ob;
        case EEP_DB_2:
                return pModal[1].db;
-       case EEP_MINOR_REV:
-               return AR5416_VER_MASK;
        case EEP_TX_MASK:
                return pBase->txMask;
        case EEP_RX_MASK: