diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/pci.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/pci.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c index 78ef1f13386f..e83128c50f7b 100644 --- a/drivers/net/wireless/ath/ath9k/pci.c +++ b/drivers/net/wireless/ath/ath9k/pci.c | |||
@@ -126,7 +126,6 @@ static const struct ath_bus_ops ath_pci_bus_ops = { | |||
126 | static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | 126 | static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
127 | { | 127 | { |
128 | void __iomem *mem; | 128 | void __iomem *mem; |
129 | struct ath_wiphy *aphy; | ||
130 | struct ath_softc *sc; | 129 | struct ath_softc *sc; |
131 | struct ieee80211_hw *hw; | 130 | struct ieee80211_hw *hw; |
132 | u8 csz; | 131 | u8 csz; |
@@ -198,8 +197,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
198 | goto err_iomap; | 197 | goto err_iomap; |
199 | } | 198 | } |
200 | 199 | ||
201 | hw = ieee80211_alloc_hw(sizeof(struct ath_wiphy) + | 200 | hw = ieee80211_alloc_hw(sizeof(struct ath_softc), &ath9k_ops); |
202 | sizeof(struct ath_softc), &ath9k_ops); | ||
203 | if (!hw) { | 201 | if (!hw) { |
204 | dev_err(&pdev->dev, "No memory for ieee80211_hw\n"); | 202 | dev_err(&pdev->dev, "No memory for ieee80211_hw\n"); |
205 | ret = -ENOMEM; | 203 | ret = -ENOMEM; |
@@ -209,11 +207,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
209 | SET_IEEE80211_DEV(hw, &pdev->dev); | 207 | SET_IEEE80211_DEV(hw, &pdev->dev); |
210 | pci_set_drvdata(pdev, hw); | 208 | pci_set_drvdata(pdev, hw); |
211 | 209 | ||
212 | aphy = hw->priv; | 210 | sc = hw->priv; |
213 | sc = (struct ath_softc *) (aphy + 1); | ||
214 | aphy->sc = sc; | ||
215 | aphy->hw = hw; | ||
216 | sc->pri_wiphy = aphy; | ||
217 | sc->hw = hw; | 211 | sc->hw = hw; |
218 | sc->dev = &pdev->dev; | 212 | sc->dev = &pdev->dev; |
219 | sc->mem = mem; | 213 | sc->mem = mem; |
@@ -260,8 +254,7 @@ err_dma: | |||
260 | static void ath_pci_remove(struct pci_dev *pdev) | 254 | static void ath_pci_remove(struct pci_dev *pdev) |
261 | { | 255 | { |
262 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); | 256 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); |
263 | struct ath_wiphy *aphy = hw->priv; | 257 | struct ath_softc *sc = hw->priv; |
264 | struct ath_softc *sc = aphy->sc; | ||
265 | void __iomem *mem = sc->mem; | 258 | void __iomem *mem = sc->mem; |
266 | 259 | ||
267 | if (!is_ath9k_unloaded) | 260 | if (!is_ath9k_unloaded) |
@@ -281,8 +274,7 @@ static int ath_pci_suspend(struct device *device) | |||
281 | { | 274 | { |
282 | struct pci_dev *pdev = to_pci_dev(device); | 275 | struct pci_dev *pdev = to_pci_dev(device); |
283 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); | 276 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); |
284 | struct ath_wiphy *aphy = hw->priv; | 277 | struct ath_softc *sc = hw->priv; |
285 | struct ath_softc *sc = aphy->sc; | ||
286 | 278 | ||
287 | ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1); | 279 | ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1); |
288 | 280 | ||
@@ -293,8 +285,7 @@ static int ath_pci_resume(struct device *device) | |||
293 | { | 285 | { |
294 | struct pci_dev *pdev = to_pci_dev(device); | 286 | struct pci_dev *pdev = to_pci_dev(device); |
295 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); | 287 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); |
296 | struct ath_wiphy *aphy = hw->priv; | 288 | struct ath_softc *sc = hw->priv; |
297 | struct ath_softc *sc = aphy->sc; | ||
298 | u32 val; | 289 | u32 val; |
299 | 290 | ||
300 | /* | 291 | /* |
@@ -320,7 +311,6 @@ static int ath_pci_resume(struct device *device) | |||
320 | ath9k_ps_restore(sc); | 311 | ath9k_ps_restore(sc); |
321 | 312 | ||
322 | sc->ps_idle = true; | 313 | sc->ps_idle = true; |
323 | ath9k_set_wiphy_idle(aphy, true); | ||
324 | ath_radio_disable(sc, hw); | 314 | ath_radio_disable(sc, hw); |
325 | 315 | ||
326 | return 0; | 316 | return 0; |