aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/main.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-03-26 13:29:40 -0400
committerIngo Molnar <mingo@elte.hu>2009-03-26 13:29:40 -0400
commit5a54bd1307471c1cd0521402fe65e2057edcab2f (patch)
tree25fb6a543db4ccc11b6d5662ed2e7facfce39ae7 /drivers/net/wireless/ath9k/main.c
parentf9f35677d81adb0feedcd6e0e661784805c8facd (diff)
parent8e0ee43bc2c3e19db56a4adaa9a9b04ce885cd84 (diff)
Merge commit 'v2.6.29' into core/header-fixes
Diffstat (limited to 'drivers/net/wireless/ath9k/main.c')
-rw-r--r--drivers/net/wireless/ath9k/main.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index 727f067aca4f..3c04044a60bd 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -1336,6 +1336,7 @@ static int ath_init(u16 devid, struct ath_softc *sc)
1336 printk(KERN_ERR "Unable to create debugfs files\n"); 1336 printk(KERN_ERR "Unable to create debugfs files\n");
1337 1337
1338 spin_lock_init(&sc->sc_resetlock); 1338 spin_lock_init(&sc->sc_resetlock);
1339 spin_lock_init(&sc->sc_serial_rw);
1339 mutex_init(&sc->mutex); 1340 mutex_init(&sc->mutex);
1340 tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc); 1341 tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc);
1341 tasklet_init(&sc->bcon_tasklet, ath9k_beacon_tasklet, 1342 tasklet_init(&sc->bcon_tasklet, ath9k_beacon_tasklet,
@@ -1538,6 +1539,7 @@ bad2:
1538bad: 1539bad:
1539 if (ah) 1540 if (ah)
1540 ath9k_hw_detach(ah); 1541 ath9k_hw_detach(ah);
1542 ath9k_exit_debug(sc);
1541 1543
1542 return error; 1544 return error;
1543} 1545}
@@ -1545,7 +1547,7 @@ bad:
1545static int ath_attach(u16 devid, struct ath_softc *sc) 1547static int ath_attach(u16 devid, struct ath_softc *sc)
1546{ 1548{
1547 struct ieee80211_hw *hw = sc->hw; 1549 struct ieee80211_hw *hw = sc->hw;
1548 int error = 0; 1550 int error = 0, i;
1549 1551
1550 DPRINTF(sc, ATH_DBG_CONFIG, "Attach ATH hw\n"); 1552 DPRINTF(sc, ATH_DBG_CONFIG, "Attach ATH hw\n");
1551 1553
@@ -1589,11 +1591,11 @@ static int ath_attach(u16 devid, struct ath_softc *sc)
1589 /* initialize tx/rx engine */ 1591 /* initialize tx/rx engine */
1590 error = ath_tx_init(sc, ATH_TXBUF); 1592 error = ath_tx_init(sc, ATH_TXBUF);
1591 if (error != 0) 1593 if (error != 0)
1592 goto detach; 1594 goto error_attach;
1593 1595
1594 error = ath_rx_init(sc, ATH_RXBUF); 1596 error = ath_rx_init(sc, ATH_RXBUF);
1595 if (error != 0) 1597 if (error != 0)
1596 goto detach; 1598 goto error_attach;
1597 1599
1598#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) 1600#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE)
1599 /* Initialze h/w Rfkill */ 1601 /* Initialze h/w Rfkill */
@@ -1601,8 +1603,9 @@ static int ath_attach(u16 devid, struct ath_softc *sc)
1601 INIT_DELAYED_WORK(&sc->rf_kill.rfkill_poll, ath_rfkill_poll); 1603 INIT_DELAYED_WORK(&sc->rf_kill.rfkill_poll, ath_rfkill_poll);
1602 1604
1603 /* Initialize s/w rfkill */ 1605 /* Initialize s/w rfkill */
1604 if (ath_init_sw_rfkill(sc)) 1606 error = ath_init_sw_rfkill(sc);
1605 goto detach; 1607 if (error)
1608 goto error_attach;
1606#endif 1609#endif
1607 1610
1608 error = ieee80211_register_hw(hw); 1611 error = ieee80211_register_hw(hw);
@@ -1611,8 +1614,16 @@ static int ath_attach(u16 devid, struct ath_softc *sc)
1611 ath_init_leds(sc); 1614 ath_init_leds(sc);
1612 1615
1613 return 0; 1616 return 0;
1614detach: 1617
1615 ath_detach(sc); 1618error_attach:
1619 /* cleanup tx queues */
1620 for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++)
1621 if (ATH_TXQ_SETUP(sc, i))
1622 ath_tx_cleanupq(sc, &sc->tx.txq[i]);
1623
1624 ath9k_hw_detach(sc->sc_ah);
1625 ath9k_exit_debug(sc);
1626
1616 return error; 1627 return error;
1617} 1628}
1618 1629