diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ahb.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ahb.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ahb.c b/drivers/net/wireless/ath/ath9k/ahb.c index 329e6bc137a..9e62a569e81 100644 --- a/drivers/net/wireless/ath/ath9k/ahb.c +++ b/drivers/net/wireless/ath/ath9k/ahb.c | |||
@@ -121,16 +121,19 @@ 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 | /* Will be cleared in ath9k_start() */ |
125 | sc->sc_flags |= SC_OP_INVALID; | ||
126 | |||
127 | ret = request_irq(irq, ath_isr, IRQF_SHARED, "ath9k", sc); | ||
125 | if (ret) { | 128 | if (ret) { |
126 | dev_err(&pdev->dev, "failed to initialize device\n"); | 129 | dev_err(&pdev->dev, "request_irq failed\n"); |
127 | goto err_free_hw; | 130 | goto err_free_hw; |
128 | } | 131 | } |
129 | 132 | ||
130 | ret = request_irq(irq, ath_isr, IRQF_SHARED, "ath9k", sc); | 133 | ret = ath9k_init_device(AR5416_AR9100_DEVID, sc, 0x0, &ath_ahb_bus_ops); |
131 | if (ret) { | 134 | if (ret) { |
132 | dev_err(&pdev->dev, "request_irq failed\n"); | 135 | dev_err(&pdev->dev, "failed to initialize device\n"); |
133 | goto err_detach; | 136 | goto err_irq; |
134 | } | 137 | } |
135 | 138 | ||
136 | ah = sc->sc_ah; | 139 | ah = sc->sc_ah; |
@@ -143,8 +146,8 @@ static int ath_ahb_probe(struct platform_device *pdev) | |||
143 | 146 | ||
144 | return 0; | 147 | return 0; |
145 | 148 | ||
146 | err_detach: | 149 | err_irq: |
147 | ath_detach(sc); | 150 | free_irq(irq, sc); |
148 | err_free_hw: | 151 | err_free_hw: |
149 | ieee80211_free_hw(hw); | 152 | ieee80211_free_hw(hw); |
150 | platform_set_drvdata(pdev, NULL); | 153 | platform_set_drvdata(pdev, NULL); |
@@ -161,8 +164,12 @@ static int ath_ahb_remove(struct platform_device *pdev) | |||
161 | if (hw) { | 164 | if (hw) { |
162 | struct ath_wiphy *aphy = hw->priv; | 165 | struct ath_wiphy *aphy = hw->priv; |
163 | struct ath_softc *sc = aphy->sc; | 166 | struct ath_softc *sc = aphy->sc; |
167 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | ||
164 | 168 | ||
165 | ath_cleanup(sc); | 169 | ath9k_deinit_device(sc); |
170 | free_irq(sc->irq, sc); | ||
171 | ieee80211_free_hw(sc->hw); | ||
172 | ath_bus_cleanup(common); | ||
166 | platform_set_drvdata(pdev, NULL); | 173 | platform_set_drvdata(pdev, NULL); |
167 | } | 174 | } |
168 | 175 | ||