Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 159422
b: refs/heads/master
c: 95fafca
h: refs/heads/master
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Aug 4, 2009
1 parent b081789 commit 53249ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3ce1b1a949ae849fb73556867e60977a65ca3141
refs/heads/master: 95fafca26dc317b7ea0667c57576b0b5389f5bef
24 changes: 8 additions & 16 deletions trunk/drivers/net/wireless/ath/ath9k/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,26 +898,22 @@ static void ath9k_hw_init_11a_eeprom_fix(struct ath_hw *ah)

int ath9k_hw_init(struct ath_hw *ah)
{
int r;
int r = 0;

if (!ath9k_hw_devid_supported(ah->hw_version.devid)) {
r = -EOPNOTSUPP;
goto bad;
}
if (!ath9k_hw_devid_supported(ah->hw_version.devid))
return -EOPNOTSUPP;

ath9k_hw_init_defaults(ah);
ath9k_hw_init_config(ah);

if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_POWER_ON)) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, "Couldn't reset chip\n");
r = -EIO;
goto bad;
return -EIO;
}

if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL, "Couldn't wakeup chip\n");
r = -EIO;
goto bad;
return -EIO;
}

if (ah->config.serialize_regmode == SER_REG_MODE_AUTO) {
Expand All @@ -939,8 +935,7 @@ int ath9k_hw_init(struct ath_hw *ah)
"Mac Chip Rev 0x%02x.%x is not supported by "
"this driver\n", ah->hw_version.macVersion,
ah->hw_version.macRev);
r = -EOPNOTSUPP;
goto bad;
return -EOPNOTSUPP;
}

if (AR_SREV_9100(ah)) {
Expand All @@ -965,7 +960,7 @@ int ath9k_hw_init(struct ath_hw *ah)

r = ath9k_hw_post_init(ah);
if (r)
goto bad;
return r;

ath9k_hw_init_mode_gain_regs(ah);
ath9k_hw_fill_cap_info(ah);
Expand All @@ -975,7 +970,7 @@ int ath9k_hw_init(struct ath_hw *ah)
if (r) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL,
"Failed to initialize MAC address\n");
goto bad;
return r;
}

if (AR_SREV_9285(ah))
Expand All @@ -986,9 +981,6 @@ int ath9k_hw_init(struct ath_hw *ah)
ath9k_init_nfcal_hist_buffer(ah);

return 0;
bad:
ath9k_hw_detach(ah);
return r;
}

static void ath9k_hw_init_bb(struct ath_hw *ah,
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1520,8 +1520,7 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc)
if (ATH_TXQ_SETUP(sc, i))
ath_tx_cleanupq(sc, &sc->tx.txq[i]);
bad:
if (ah)
ath9k_hw_detach(ah);
ath9k_hw_detach(ah);
sc->sc_ah = NULL;
bad_no_ah:
ath9k_exit_debug(sc);
Expand Down

0 comments on commit 53249ba

Please sign in to comment.