diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2008-10-10 15:25:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-10 15:25:45 -0400 |
commit | 1cf69cfbe117d645640a9230d6deb07c9db46c5f (patch) | |
tree | 4b3e2ec604df825178ca6789d34170f834152e29 /drivers/net/wireless/ath9k | |
parent | 4d74f8ba1fb152ae07eb858abb713e094e77b7d5 (diff) |
ath9k: remove nasty FAIL macro from ath9k_hw_reset()
This is fucking horribe crap code so nuke it. There I cursed too in a commit log.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/ath9k')
-rw-r--r-- | drivers/net/wireless/ath9k/hw.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c index 62e44a0ef996..372ae61c7b17 100644 --- a/drivers/net/wireless/ath9k/hw.c +++ b/drivers/net/wireless/ath9k/hw.c | |||
@@ -5867,7 +5867,6 @@ bool ath9k_hw_reset(struct ath_hal *ah, | |||
5867 | bool bChannelChange, | 5867 | bool bChannelChange, |
5868 | int *status) | 5868 | int *status) |
5869 | { | 5869 | { |
5870 | #define FAIL(_code) do { ecode = _code; goto bad; } while (0) | ||
5871 | u32 saveLedState; | 5870 | u32 saveLedState; |
5872 | struct ath_hal_5416 *ahp = AH5416(ah); | 5871 | struct ath_hal_5416 *ahp = AH5416(ah); |
5873 | struct ath9k_channel *curchan = ah->ah_curchan; | 5872 | struct ath9k_channel *curchan = ah->ah_curchan; |
@@ -5889,7 +5888,8 @@ bool ath9k_hw_reset(struct ath_hal *ah, | |||
5889 | DPRINTF(ah->ah_sc, ATH_DBG_CHANNEL, | 5888 | DPRINTF(ah->ah_sc, ATH_DBG_CHANNEL, |
5890 | "%s: invalid channel %u/0x%x; no mapping\n", | 5889 | "%s: invalid channel %u/0x%x; no mapping\n", |
5891 | __func__, chan->channel, chan->channelFlags); | 5890 | __func__, chan->channel, chan->channelFlags); |
5892 | FAIL(-EINVAL); | 5891 | ecode = -EINVAL; |
5892 | goto bad; | ||
5893 | } | 5893 | } |
5894 | 5894 | ||
5895 | if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) | 5895 | if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) |
@@ -5930,7 +5930,8 @@ bool ath9k_hw_reset(struct ath_hal *ah, | |||
5930 | if (!ath9k_hw_chip_reset(ah, chan)) { | 5930 | if (!ath9k_hw_chip_reset(ah, chan)) { |
5931 | DPRINTF(ah->ah_sc, ATH_DBG_RESET, "%s: chip reset failed\n", | 5931 | DPRINTF(ah->ah_sc, ATH_DBG_RESET, "%s: chip reset failed\n", |
5932 | __func__); | 5932 | __func__); |
5933 | FAIL(-EIO); | 5933 | ecode = -EINVAL; |
5934 | goto bad; | ||
5934 | } | 5935 | } |
5935 | 5936 | ||
5936 | if (AR_SREV_9280(ah)) { | 5937 | if (AR_SREV_9280(ah)) { |
@@ -5947,8 +5948,10 @@ bool ath9k_hw_reset(struct ath_hal *ah, | |||
5947 | } | 5948 | } |
5948 | 5949 | ||
5949 | ecode = ath9k_hw_process_ini(ah, chan, macmode); | 5950 | ecode = ath9k_hw_process_ini(ah, chan, macmode); |
5950 | if (ecode != 0) | 5951 | if (ecode != 0) { |
5952 | ecode = -EINVAL; | ||
5951 | goto bad; | 5953 | goto bad; |
5954 | } | ||
5952 | 5955 | ||
5953 | if (IS_CHAN_OFDM(chan) || IS_CHAN_HT(chan)) | 5956 | if (IS_CHAN_OFDM(chan) || IS_CHAN_HT(chan)) |
5954 | ath9k_hw_set_delta_slope(ah, chan); | 5957 | ath9k_hw_set_delta_slope(ah, chan); |
@@ -5961,7 +5964,8 @@ bool ath9k_hw_reset(struct ath_hal *ah, | |||
5961 | if (!ath9k_hw_eeprom_set_board_values(ah, chan)) { | 5964 | if (!ath9k_hw_eeprom_set_board_values(ah, chan)) { |
5962 | DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, | 5965 | DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, |
5963 | "%s: error setting board options\n", __func__); | 5966 | "%s: error setting board options\n", __func__); |
5964 | FAIL(-EIO); | 5967 | ecode = -EIO; |
5968 | goto bad; | ||
5965 | } | 5969 | } |
5966 | 5970 | ||
5967 | ath9k_hw_decrease_chain_power(ah, chan); | 5971 | ath9k_hw_decrease_chain_power(ah, chan); |
@@ -5989,11 +5993,15 @@ bool ath9k_hw_reset(struct ath_hal *ah, | |||
5989 | REG_WRITE(ah, AR_RSSI_THR, INIT_RSSI_THR); | 5993 | REG_WRITE(ah, AR_RSSI_THR, INIT_RSSI_THR); |
5990 | 5994 | ||
5991 | if (AR_SREV_9280_10_OR_LATER(ah)) { | 5995 | if (AR_SREV_9280_10_OR_LATER(ah)) { |
5992 | if (!(ath9k_hw_ar9280_set_channel(ah, chan))) | 5996 | if (!(ath9k_hw_ar9280_set_channel(ah, chan))) { |
5993 | FAIL(-EIO); | 5997 | ecode = -EIO; |
5998 | goto bad; | ||
5999 | } | ||
5994 | } else { | 6000 | } else { |
5995 | if (!(ath9k_hw_set_channel(ah, chan))) | 6001 | if (!(ath9k_hw_set_channel(ah, chan))) { |
5996 | FAIL(-EIO); | 6002 | ecode = -EIO; |
6003 | goto bad; | ||
6004 | } | ||
5997 | } | 6005 | } |
5998 | 6006 | ||
5999 | for (i = 0; i < AR_NUM_DCU; i++) | 6007 | for (i = 0; i < AR_NUM_DCU; i++) |
@@ -6027,8 +6035,10 @@ bool ath9k_hw_reset(struct ath_hal *ah, | |||
6027 | 6035 | ||
6028 | ath9k_hw_init_bb(ah, chan); | 6036 | ath9k_hw_init_bb(ah, chan); |
6029 | 6037 | ||
6030 | if (!ath9k_hw_init_cal(ah, chan)) | 6038 | if (!ath9k_hw_init_cal(ah, chan)){ |
6031 | FAIL(-ENODEV); | 6039 | ecode = -EIO;; |
6040 | goto bad; | ||
6041 | } | ||
6032 | 6042 | ||
6033 | rx_chainmask = ahp->ah_rxchainmask; | 6043 | rx_chainmask = ahp->ah_rxchainmask; |
6034 | if ((rx_chainmask == 0x5) || (rx_chainmask == 0x3)) { | 6044 | if ((rx_chainmask == 0x5) || (rx_chainmask == 0x3)) { |
@@ -6064,7 +6074,6 @@ bad: | |||
6064 | if (status) | 6074 | if (status) |
6065 | *status = ecode; | 6075 | *status = ecode; |
6066 | return false; | 6076 | return false; |
6067 | #undef FAIL | ||
6068 | } | 6077 | } |
6069 | 6078 | ||
6070 | bool ath9k_hw_phy_disable(struct ath_hal *ah) | 6079 | bool ath9k_hw_phy_disable(struct ath_hal *ah) |