diff options
Diffstat (limited to 'drivers/net/wireless/ath9k/ahb.c')
-rw-r--r-- | drivers/net/wireless/ath9k/ahb.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath9k/ahb.c b/drivers/net/wireless/ath9k/ahb.c index 391c9fd3b646..bc562bd88890 100644 --- a/drivers/net/wireless/ath9k/ahb.c +++ b/drivers/net/wireless/ath9k/ahb.c | |||
@@ -96,7 +96,8 @@ static int ath_ahb_probe(struct platform_device *pdev) | |||
96 | 96 | ||
97 | irq = res->start; | 97 | irq = res->start; |
98 | 98 | ||
99 | hw = ieee80211_alloc_hw(sizeof(struct ath_softc), &ath9k_ops); | 99 | hw = ieee80211_alloc_hw(sizeof(struct ath_wiphy) + |
100 | sizeof(struct ath_softc), &ath9k_ops); | ||
100 | if (hw == NULL) { | 101 | if (hw == NULL) { |
101 | dev_err(&pdev->dev, "no memory for ieee80211_hw\n"); | 102 | dev_err(&pdev->dev, "no memory for ieee80211_hw\n"); |
102 | ret = -ENOMEM; | 103 | ret = -ENOMEM; |
@@ -106,7 +107,11 @@ static int ath_ahb_probe(struct platform_device *pdev) | |||
106 | SET_IEEE80211_DEV(hw, &pdev->dev); | 107 | SET_IEEE80211_DEV(hw, &pdev->dev); |
107 | platform_set_drvdata(pdev, hw); | 108 | platform_set_drvdata(pdev, hw); |
108 | 109 | ||
109 | sc = hw->priv; | 110 | aphy = hw->priv; |
111 | sc = (struct ath_softc *) (aphy + 1); | ||
112 | aphy->sc = sc; | ||
113 | aphy->hw = hw; | ||
114 | sc->pri_wiphy = aphy; | ||
110 | sc->hw = hw; | 115 | sc->hw = hw; |
111 | sc->dev = &pdev->dev; | 116 | sc->dev = &pdev->dev; |
112 | sc->mem = mem; | 117 | sc->mem = mem; |
@@ -156,7 +161,8 @@ static int ath_ahb_remove(struct platform_device *pdev) | |||
156 | struct ieee80211_hw *hw = platform_get_drvdata(pdev); | 161 | struct ieee80211_hw *hw = platform_get_drvdata(pdev); |
157 | 162 | ||
158 | if (hw) { | 163 | if (hw) { |
159 | struct ath_softc *sc = hw->priv; | 164 | struct ath_wiphy *aphy = hw->priv; |
165 | struct ath_softc *sc = aphy->sc; | ||
160 | 166 | ||
161 | ath_cleanup(sc); | 167 | ath_cleanup(sc); |
162 | platform_set_drvdata(pdev, NULL); | 168 | platform_set_drvdata(pdev, NULL); |