diff options
author | David S. Miller <davem@davemloft.net> | 2009-02-25 00:02:05 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-25 00:02:05 -0800 |
commit | f11c179eea77b8afc2fb7cb4b9a8815b85e3c16f (patch) | |
tree | 9edf1e86fbb91815f31d7728820d098041f03bb9 /drivers/net/wireless/ath9k/main.c | |
parent | 4545a3f2765bb7d2d93468a8ffa578ac87a2c5c7 (diff) | |
parent | 0c9a3aaaf30e1d1994de58c554ef97a719e20892 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/wireless/orinoco/orinoco.c
Diffstat (limited to 'drivers/net/wireless/ath9k/main.c')
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index fc3460f8f7f..7d7537e2738 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c @@ -1558,6 +1558,7 @@ bad2: bad: if (ah) ath9k_hw_detach(ah); + ath9k_exit_debug(sc); return error; } @@ -1565,7 +1566,7 @@ bad: int ath_attach(u16 devid, struct ath_softc *sc) { struct ieee80211_hw *hw = sc->hw; - int error = 0; + int error = 0, i; DPRINTF(sc, ATH_DBG_CONFIG, "Attach ATH hw\n"); @@ -1617,11 +1618,11 @@ int ath_attach(u16 devid, struct ath_softc *sc) /* initialize tx/rx engine */ error = ath_tx_init(sc, ATH_TXBUF); if (error != 0) - goto detach; + goto error_attach; error = ath_rx_init(sc, ATH_RXBUF); if (error != 0) - goto detach; + goto error_attach; #if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) /* Initialze h/w Rfkill */ @@ -1629,8 +1630,9 @@ int ath_attach(u16 devid, struct ath_softc *sc) INIT_DELAYED_WORK(&sc->rf_kill.rfkill_poll, ath_rfkill_poll); /* Initialize s/w rfkill */ - if (ath_init_sw_rfkill(sc)) - goto detach; + error = ath_init_sw_rfkill(sc); + if (error) + goto error_attach; #endif if (ath9k_is_world_regd(sc->sc_ah)) { @@ -1664,8 +1666,16 @@ int ath_attach(u16 devid, struct ath_softc *sc) return 0; -detach: - ath_detach(sc); + +error_attach: + /* cleanup tx queues */ + for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) + if (ATH_TXQ_SETUP(sc, i)) + ath_tx_cleanupq(sc, &sc->tx.txq[i]); + + ath9k_hw_detach(sc->sc_ah); + ath9k_exit_debug(sc); + return error; } |