diff options
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: | |||
1558 | bad: | 1558 | bad: |
1559 | if (ah) | 1559 | if (ah) |
1560 | ath9k_hw_detach(ah); | 1560 | ath9k_hw_detach(ah); |
1561 | ath9k_exit_debug(sc); | ||
1561 | 1562 | ||
1562 | return error; | 1563 | return error; |
1563 | } | 1564 | } |
@@ -1565,7 +1566,7 @@ bad: | |||
1565 | int ath_attach(u16 devid, struct ath_softc *sc) | 1566 | int ath_attach(u16 devid, struct ath_softc *sc) |
1566 | { | 1567 | { |
1567 | struct ieee80211_hw *hw = sc->hw; | 1568 | struct ieee80211_hw *hw = sc->hw; |
1568 | int error = 0; | 1569 | int error = 0, i; |
1569 | 1570 | ||
1570 | DPRINTF(sc, ATH_DBG_CONFIG, "Attach ATH hw\n"); | 1571 | DPRINTF(sc, ATH_DBG_CONFIG, "Attach ATH hw\n"); |
1571 | 1572 | ||
@@ -1617,11 +1618,11 @@ int ath_attach(u16 devid, struct ath_softc *sc) | |||
1617 | /* initialize tx/rx engine */ | 1618 | /* initialize tx/rx engine */ |
1618 | error = ath_tx_init(sc, ATH_TXBUF); | 1619 | error = ath_tx_init(sc, ATH_TXBUF); |
1619 | if (error != 0) | 1620 | if (error != 0) |
1620 | goto detach; | 1621 | goto error_attach; |
1621 | 1622 | ||
1622 | error = ath_rx_init(sc, ATH_RXBUF); | 1623 | error = ath_rx_init(sc, ATH_RXBUF); |
1623 | if (error != 0) | 1624 | if (error != 0) |
1624 | goto detach; | 1625 | goto error_attach; |
1625 | 1626 | ||
1626 | #if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) | 1627 | #if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) |
1627 | /* Initialze h/w Rfkill */ | 1628 | /* Initialze h/w Rfkill */ |
@@ -1629,8 +1630,9 @@ int ath_attach(u16 devid, struct ath_softc *sc) | |||
1629 | INIT_DELAYED_WORK(&sc->rf_kill.rfkill_poll, ath_rfkill_poll); | 1630 | INIT_DELAYED_WORK(&sc->rf_kill.rfkill_poll, ath_rfkill_poll); |
1630 | 1631 | ||
1631 | /* Initialize s/w rfkill */ | 1632 | /* Initialize s/w rfkill */ |
1632 | if (ath_init_sw_rfkill(sc)) | 1633 | error = ath_init_sw_rfkill(sc); |
1633 | goto detach; | 1634 | if (error) |
1635 | goto error_attach; | ||
1634 | #endif | 1636 | #endif |
1635 | 1637 | ||
1636 | if (ath9k_is_world_regd(sc->sc_ah)) { | 1638 | if (ath9k_is_world_regd(sc->sc_ah)) { |
@@ -1664,8 +1666,16 @@ int ath_attach(u16 devid, struct ath_softc *sc) | |||
1664 | 1666 | ||
1665 | 1667 | ||
1666 | return 0; | 1668 | return 0; |
1667 | detach: | 1669 | |
1668 | ath_detach(sc); | 1670 | error_attach: |
1671 | /* cleanup tx queues */ | ||
1672 | for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) | ||
1673 | if (ATH_TXQ_SETUP(sc, i)) | ||
1674 | ath_tx_cleanupq(sc, &sc->tx.txq[i]); | ||
1675 | |||
1676 | ath9k_hw_detach(sc->sc_ah); | ||
1677 | ath9k_exit_debug(sc); | ||
1678 | |||
1669 | return error; | 1679 | return error; |
1670 | } | 1680 | } |
1671 | 1681 | ||