.. | .. |
---|
825 | 825 | struct pci_dev *pdev = to_pci_dev(sc->dev); |
---|
826 | 826 | struct pci_dev *parent; |
---|
827 | 827 | u16 aspm; |
---|
| 828 | + int ret; |
---|
828 | 829 | |
---|
829 | 830 | if (!ah->is_pciexpress) |
---|
830 | 831 | return; |
---|
.. | .. |
---|
866 | 867 | if (AR_SREV_9462(ah)) |
---|
867 | 868 | pci_read_config_dword(pdev, 0x70c, &ah->config.aspm_l1_fix); |
---|
868 | 869 | |
---|
869 | | - pcie_capability_read_word(parent, PCI_EXP_LNKCTL, &aspm); |
---|
870 | | - if (aspm & (PCI_EXP_LNKCTL_ASPM_L0S | PCI_EXP_LNKCTL_ASPM_L1)) { |
---|
| 870 | + ret = pcie_capability_read_word(parent, PCI_EXP_LNKCTL, &aspm); |
---|
| 871 | + if (!ret && (aspm & (PCI_EXP_LNKCTL_ASPM_L0S | PCI_EXP_LNKCTL_ASPM_L1))) { |
---|
871 | 872 | ah->aspm_enabled = true; |
---|
872 | 873 | /* Initialize PCIe PM and SERDES registers. */ |
---|
873 | 874 | ath9k_hw_configpcipowersave(ah, false); |
---|
.. | .. |
---|
993 | 994 | sc->sc_ah->msi_reg = 0; |
---|
994 | 995 | |
---|
995 | 996 | ath9k_hw_name(sc->sc_ah, hw_name, sizeof(hw_name)); |
---|
996 | | - wiphy_info(hw->wiphy, "%s mem=0x%lx, irq=%d\n", |
---|
997 | | - hw_name, (unsigned long)sc->mem, pdev->irq); |
---|
| 997 | + wiphy_info(hw->wiphy, "%s mem=0x%p, irq=%d\n", |
---|
| 998 | + hw_name, sc->mem, pdev->irq); |
---|
998 | 999 | |
---|
999 | 1000 | return 0; |
---|
1000 | 1001 | |
---|
.. | .. |
---|
1021 | 1022 | |
---|
1022 | 1023 | static int ath_pci_suspend(struct device *device) |
---|
1023 | 1024 | { |
---|
1024 | | - struct pci_dev *pdev = to_pci_dev(device); |
---|
1025 | | - struct ieee80211_hw *hw = pci_get_drvdata(pdev); |
---|
| 1025 | + struct ieee80211_hw *hw = dev_get_drvdata(device); |
---|
1026 | 1026 | struct ath_softc *sc = hw->priv; |
---|
1027 | 1027 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
---|
1028 | 1028 | |
---|
1029 | 1029 | if (test_bit(ATH_OP_WOW_ENABLED, &common->op_flags)) { |
---|
1030 | | - dev_info(&pdev->dev, "WOW is enabled, bypassing PCI suspend\n"); |
---|
| 1030 | + dev_info(device, "WOW is enabled, bypassing PCI suspend\n"); |
---|
1031 | 1031 | return 0; |
---|
1032 | 1032 | } |
---|
1033 | 1033 | |
---|