diff options
| -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 727f067aca4f..0e80990d8e84 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
| @@ -1538,6 +1538,7 @@ bad2: | |||
| 1538 | bad: | 1538 | bad: |
| 1539 | if (ah) | 1539 | if (ah) |
| 1540 | ath9k_hw_detach(ah); | 1540 | ath9k_hw_detach(ah); |
| 1541 | ath9k_exit_debug(sc); | ||
| 1541 | 1542 | ||
| 1542 | return error; | 1543 | return error; |
| 1543 | } | 1544 | } |
| @@ -1545,7 +1546,7 @@ bad: | |||
| 1545 | static int ath_attach(u16 devid, struct ath_softc *sc) | 1546 | static int ath_attach(u16 devid, struct ath_softc *sc) |
| 1546 | { | 1547 | { |
| 1547 | struct ieee80211_hw *hw = sc->hw; | 1548 | struct ieee80211_hw *hw = sc->hw; |
| 1548 | int error = 0; | 1549 | int error = 0, i; |
| 1549 | 1550 | ||
| 1550 | DPRINTF(sc, ATH_DBG_CONFIG, "Attach ATH hw\n"); | 1551 | DPRINTF(sc, ATH_DBG_CONFIG, "Attach ATH hw\n"); |
| 1551 | 1552 | ||
| @@ -1589,11 +1590,11 @@ static int ath_attach(u16 devid, struct ath_softc *sc) | |||
| 1589 | /* initialize tx/rx engine */ | 1590 | /* initialize tx/rx engine */ |
| 1590 | error = ath_tx_init(sc, ATH_TXBUF); | 1591 | error = ath_tx_init(sc, ATH_TXBUF); |
| 1591 | if (error != 0) | 1592 | if (error != 0) |
| 1592 | goto detach; | 1593 | goto error_attach; |
| 1593 | 1594 | ||
| 1594 | error = ath_rx_init(sc, ATH_RXBUF); | 1595 | error = ath_rx_init(sc, ATH_RXBUF); |
| 1595 | if (error != 0) | 1596 | if (error != 0) |
| 1596 | goto detach; | 1597 | goto error_attach; |
| 1597 | 1598 | ||
| 1598 | #if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) | 1599 | #if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) |
| 1599 | /* Initialze h/w Rfkill */ | 1600 | /* Initialze h/w Rfkill */ |
| @@ -1601,8 +1602,9 @@ static int ath_attach(u16 devid, struct ath_softc *sc) | |||
| 1601 | INIT_DELAYED_WORK(&sc->rf_kill.rfkill_poll, ath_rfkill_poll); | 1602 | INIT_DELAYED_WORK(&sc->rf_kill.rfkill_poll, ath_rfkill_poll); |
| 1602 | 1603 | ||
| 1603 | /* Initialize s/w rfkill */ | 1604 | /* Initialize s/w rfkill */ |
| 1604 | if (ath_init_sw_rfkill(sc)) | 1605 | error = ath_init_sw_rfkill(sc); |
| 1605 | goto detach; | 1606 | if (error) |
| 1607 | goto error_attach; | ||
| 1606 | #endif | 1608 | #endif |
| 1607 | 1609 | ||
| 1608 | error = ieee80211_register_hw(hw); | 1610 | error = ieee80211_register_hw(hw); |
| @@ -1611,8 +1613,16 @@ static int ath_attach(u16 devid, struct ath_softc *sc) | |||
| 1611 | ath_init_leds(sc); | 1613 | ath_init_leds(sc); |
| 1612 | 1614 | ||
| 1613 | return 0; | 1615 | return 0; |
| 1614 | detach: | 1616 | |
| 1615 | ath_detach(sc); | 1617 | error_attach: |
| 1618 | /* cleanup tx queues */ | ||
| 1619 | for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) | ||
| 1620 | if (ATH_TXQ_SETUP(sc, i)) | ||
| 1621 | ath_tx_cleanupq(sc, &sc->tx.txq[i]); | ||
| 1622 | |||
| 1623 | ath9k_hw_detach(sc->sc_ah); | ||
| 1624 | ath9k_exit_debug(sc); | ||
| 1625 | |||
| 1616 | return error; | 1626 | return error; |
| 1617 | } | 1627 | } |
| 1618 | 1628 | ||
