aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/ahb.c
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2010-01-08 00:06:07 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-12 14:02:05 -0500
commit285f2ddae03ca207877262f5a9dbd9cddd8b3913 (patch)
tree7b26606956f4d6f4c1f564718769501b34d3f640 /drivers/net/wireless/ath/ath9k/ahb.c
parent1b04b9308ebc7f6accb319cf51c9b8ec29f79707 (diff)
ath9k: Cleanup init/deinit routines
The device initialization and termination functions were messy and convoluted. Introduce helper functions to clarify init_softc() and simplify things in general. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ahb.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/ahb.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ahb.c b/drivers/net/wireless/ath/ath9k/ahb.c
index 329e6bc137ab..f24b1f4c3e29 100644
--- a/drivers/net/wireless/ath/ath9k/ahb.c
+++ b/drivers/net/wireless/ath/ath9k/ahb.c
@@ -121,16 +121,16 @@ static int ath_ahb_probe(struct platform_device *pdev)
121 sc->mem = mem; 121 sc->mem = mem;
122 sc->irq = irq; 122 sc->irq = irq;
123 123
124 ret = ath_init_device(AR5416_AR9100_DEVID, sc, 0x0, &ath_ahb_bus_ops); 124 ret = request_irq(irq, ath_isr, IRQF_SHARED, "ath9k", sc);
125 if (ret) { 125 if (ret) {
126 dev_err(&pdev->dev, "failed to initialize device\n"); 126 dev_err(&pdev->dev, "request_irq failed\n");
127 goto err_free_hw; 127 goto err_free_hw;
128 } 128 }
129 129
130 ret = request_irq(irq, ath_isr, IRQF_SHARED, "ath9k", sc); 130 ret = ath9k_init_device(AR5416_AR9100_DEVID, sc, 0x0, &ath_ahb_bus_ops);
131 if (ret) { 131 if (ret) {
132 dev_err(&pdev->dev, "request_irq failed\n"); 132 dev_err(&pdev->dev, "failed to initialize device\n");
133 goto err_detach; 133 goto err_irq;
134 } 134 }
135 135
136 ah = sc->sc_ah; 136 ah = sc->sc_ah;
@@ -143,8 +143,8 @@ static int ath_ahb_probe(struct platform_device *pdev)
143 143
144 return 0; 144 return 0;
145 145
146 err_detach: 146 err_irq:
147 ath_detach(sc); 147 free_irq(irq, sc);
148 err_free_hw: 148 err_free_hw:
149 ieee80211_free_hw(hw); 149 ieee80211_free_hw(hw);
150 platform_set_drvdata(pdev, NULL); 150 platform_set_drvdata(pdev, NULL);
@@ -161,8 +161,12 @@ static int ath_ahb_remove(struct platform_device *pdev)
161 if (hw) { 161 if (hw) {
162 struct ath_wiphy *aphy = hw->priv; 162 struct ath_wiphy *aphy = hw->priv;
163 struct ath_softc *sc = aphy->sc; 163 struct ath_softc *sc = aphy->sc;
164 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
164 165
165 ath_cleanup(sc); 166 ath9k_deinit_device(sc);
167 free_irq(sc->irq, sc);
168 ieee80211_free_hw(sc->hw);
169 ath_bus_cleanup(common);
166 platform_set_drvdata(pdev, NULL); 170 platform_set_drvdata(pdev, NULL);
167 } 171 }
168 172