2010/12/21 Bruno Randolf <br1@xxxxxxxxxxx>: > Remove redundant defines. > > Signed-off-by: Bruno Randolf <br1@xxxxxxxxxxx> > --- > Âdrivers/net/wireless/ath/ath5k/ath5k.h |  Â6 +----- > Âdrivers/net/wireless/ath/ath5k/phy.c  |  18 ++++++------------ > Âdrivers/net/wireless/ath/ath5k/reset.c |  11 +++-------- > Â3 files changed, 10 insertions(+), 25 deletions(-) > > diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h > index 342da28..5de8520 100644 > --- a/drivers/net/wireless/ath/ath5k/ath5k.h > +++ b/drivers/net/wireless/ath/ath5k/ath5k.h > @@ -154,10 +154,6 @@ >        Âudelay(1);                       Â\ > Â} while (0) > > -/* Register dumps are done per operation mode */ > -#define AR5K_INI_RFGAIN_5GHZ      0 > -#define AR5K_INI_RFGAIN_2GHZ      1 > - > Â/* > Â* Some tuneable values (these should be changeable by the user) > Â* TODO: Make use of them and add more options OR use debug/configfs > @@ -1322,7 +1318,7 @@ void ath5k_hw_set_antenna_switch(struct ath5k_hw *ah, u8 ee_mode); > Âint ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, u8 txpower); > Â/* Init function */ > Âint ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, > -                u8 mode, u8 ee_mode, u8 freq, bool fast); > +                u8 mode, u8 ee_mode, bool fast); > > Â/* > Â* Functions used internaly > diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c > index 18c58cd..b6e9621 100644 > --- a/drivers/net/wireless/ath/ath5k/phy.c > +++ b/drivers/net/wireless/ath/ath5k/phy.c > @@ -609,10 +609,10 @@ done: > Â/* Write initial RF gain table to set the RF sensitivity > Â* this one works on all RF chips and has nothing to do > Â* with gain_F calibration */ > -static int ath5k_hw_rfgain_init(struct ath5k_hw *ah, unsigned int freq) > +static int ath5k_hw_rfgain_init(struct ath5k_hw *ah, enum ieee80211_band band) > Â{ >    Âconst struct ath5k_ini_rfgain *ath5k_rfg; > -    unsigned int i, size; > +    unsigned int i, size, index; > >    Âswitch (ah->ah_radio) { >    Âcase AR5K_RF5111: > @@ -644,17 +644,11 @@ static int ath5k_hw_rfgain_init(struct ath5k_hw *ah, unsigned int freq) >        Âreturn -EINVAL; >    Â} > > -    switch (freq) { > -    case AR5K_INI_RFGAIN_2GHZ: > -    case AR5K_INI_RFGAIN_5GHZ: > -        break; > -    default: > -        return -EINVAL; > -    } > +    index = (band == IEEE80211_BAND_2GHZ) ? 1 : 0; > >    Âfor (i = 0; i < size; i++) { >        ÂAR5K_REG_WAIT(i); > -        ath5k_hw_reg_write(ah, ath5k_rfg[i].rfg_value[freq], > +        ath5k_hw_reg_write(ah, ath5k_rfg[i].rfg_value[index], >            Â(u32)ath5k_rfg[i].rfg_register); >    Â} > > @@ -3246,7 +3240,7 @@ int ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, u8 txpower) > Â\*************/ > > Âint ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, > -                u8 mode, u8 ee_mode, u8 freq, bool fast) > +                u8 mode, u8 ee_mode, bool fast) > Â{ >    Âstruct ieee80211_channel *curr_channel; >    Âint ret, i; > @@ -3305,7 +3299,7 @@ int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, >         * Write initial RF gain settings >         * This should work for both 5111/5112 >         */ > -        ret = ath5k_hw_rfgain_init(ah, freq); > +        ret = ath5k_hw_rfgain_init(ah, channel->band); >        Âif (ret) >            Âreturn ret; > > diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c > index bc84aaa..4b8b987 100644 > --- a/drivers/net/wireless/ath/ath5k/reset.c > +++ b/drivers/net/wireless/ath/ath5k/reset.c > @@ -1020,13 +1020,12 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, >        Âstruct ieee80211_channel *channel, bool fast, bool skip_pcu) > Â{ >    Âu32 s_seq[10], s_led[3], tsf_up, tsf_lo; > -    u8 mode, freq, ee_mode; > +    u8 mode, ee_mode; >    Âint i, ret; > >    Âee_mode = 0; >    Âtsf_up = 0; >    Âtsf_lo = 0; > -    freq = 0; >    Âmode = 0; > >    Â/* > @@ -1071,7 +1070,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, >    Âswitch (channel->hw_value & CHANNEL_MODES) { >    Âcase CHANNEL_A: >        Âmode = AR5K_MODE_11A; > -        freq = AR5K_INI_RFGAIN_5GHZ; >        Âee_mode = AR5K_EEPROM_MODE_11A; >        Âbreak; >    Âcase CHANNEL_G: > @@ -1083,7 +1081,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, >        Â} > >        Âmode = AR5K_MODE_11G; > -        freq = AR5K_INI_RFGAIN_2GHZ; >        Âee_mode = AR5K_EEPROM_MODE_11G; >        Âbreak; >    Âcase CHANNEL_B: > @@ -1095,7 +1092,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, >        Â} > >        Âmode = AR5K_MODE_11B; > -        freq = AR5K_INI_RFGAIN_2GHZ; >        Âee_mode = AR5K_EEPROM_MODE_11B; >        Âbreak; >    Âcase CHANNEL_XR: > @@ -1105,7 +1101,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, >            Âreturn -EINVAL; >        Â} >        Âmode = AR5K_MODE_XR; > -        freq = AR5K_INI_RFGAIN_5GHZ; >        Âee_mode = AR5K_EEPROM_MODE_11A; >        Âbreak; >    Âdefault: > @@ -1120,7 +1115,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, >     */ >    Âif (fast) { >        Âret = ath5k_hw_phy_init(ah, channel, mode, > -                    ee_mode, freq, true); > +                    ee_mode, true); >        Âif (ret) { >            ÂATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_RESET, >                Â"fast chan change failed, falling back to normal reset\n"); > @@ -1256,7 +1251,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, >    Â/* >     * Initialize PHY >     */ > -    ret = ath5k_hw_phy_init(ah, channel, mode, ee_mode, freq, false); > +    ret = ath5k_hw_phy_init(ah, channel, mode, ee_mode, false); >    Âif (ret) { >        ÂATH5K_ERR(ah->ah_sc, >            Â"failed to initialize PHY (%i) !\n", ret); > > Acked-by: Nick Kossifidis <mickflemm@xxxxxxxxx> -- GPG ID: 0xD21DB2DB As you read this post global entropy rises. Have Fun ;-) Nick -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html