ath5k: fix incorrect use of drvdata in PCI suspend/resume code
authorPavel Roskin <proski@gnu.org>
Wed, 29 Jun 2011 19:39:43 +0000 (15:39 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 5 Jul 2011 18:41:14 +0000 (14:41 -0400)
Signed-off-by: Pavel Roskin <proski@gnu.org>
Cc: <stable@kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath5k/pci.c

index 296c316a83412eaa64bd4c6bd47b264dc4910822..f2c0c236392f2663f970de02ecd8f0a7bd34f9d9 100644 (file)
@@ -297,7 +297,9 @@ ath5k_pci_remove(struct pci_dev *pdev)
 #ifdef CONFIG_PM_SLEEP
 static int ath5k_pci_suspend(struct device *dev)
 {
-       struct ath5k_softc *sc = pci_get_drvdata(to_pci_dev(dev));
+       struct pci_dev *pdev = to_pci_dev(dev);
+       struct ieee80211_hw *hw = pci_get_drvdata(pdev);
+       struct ath5k_softc *sc = hw->priv;
 
        ath5k_led_off(sc);
        return 0;
@@ -306,7 +308,8 @@ static int ath5k_pci_suspend(struct device *dev)
 static int ath5k_pci_resume(struct device *dev)
 {
        struct pci_dev *pdev = to_pci_dev(dev);
-       struct ath5k_softc *sc = pci_get_drvdata(pdev);
+       struct ieee80211_hw *hw = pci_get_drvdata(pdev);
+       struct ath5k_softc *sc = hw->priv;
 
        /*
         * Suspend/Resume resets the PCI configuration space, so we have to