hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/drivers/net/wireless/ath/ath9k/pci.c
....@@ -825,6 +825,7 @@
825825 struct pci_dev *pdev = to_pci_dev(sc->dev);
826826 struct pci_dev *parent;
827827 u16 aspm;
828
+ int ret;
828829
829830 if (!ah->is_pciexpress)
830831 return;
....@@ -866,8 +867,8 @@
866867 if (AR_SREV_9462(ah))
867868 pci_read_config_dword(pdev, 0x70c, &ah->config.aspm_l1_fix);
868869
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))) {
871872 ah->aspm_enabled = true;
872873 /* Initialize PCIe PM and SERDES registers. */
873874 ath9k_hw_configpcipowersave(ah, false);
....@@ -993,8 +994,8 @@
993994 sc->sc_ah->msi_reg = 0;
994995
995996 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);
998999
9991000 return 0;
10001001
....@@ -1021,13 +1022,12 @@
10211022
10221023 static int ath_pci_suspend(struct device *device)
10231024 {
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);
10261026 struct ath_softc *sc = hw->priv;
10271027 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
10281028
10291029 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");
10311031 return 0;
10321032 }
10331033