aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/access.c4
-rw-r--r--drivers/pci/pcie/portdrv_core.c2
-rw-r--r--include/linux/pci.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/drivers/pci/access.c b/drivers/pci/access.c
index 3af0478c057b..5278ac692cbf 100644
--- a/drivers/pci/access.c
+++ b/drivers/pci/access.c
@@ -472,7 +472,7 @@ EXPORT_SYMBOL_GPL(pci_cfg_access_unlock);
472 472
473static inline int pcie_cap_version(const struct pci_dev *dev) 473static inline int pcie_cap_version(const struct pci_dev *dev)
474{ 474{
475 return dev->pcie_flags_reg & PCI_EXP_FLAGS_VERS; 475 return pcie_caps_reg(dev) & PCI_EXP_FLAGS_VERS;
476} 476}
477 477
478static inline bool pcie_cap_has_devctl(const struct pci_dev *dev) 478static inline bool pcie_cap_has_devctl(const struct pci_dev *dev)
@@ -497,7 +497,7 @@ static inline bool pcie_cap_has_sltctl(const struct pci_dev *dev)
497 return pcie_cap_version(dev) > 1 || 497 return pcie_cap_version(dev) > 1 ||
498 type == PCI_EXP_TYPE_ROOT_PORT || 498 type == PCI_EXP_TYPE_ROOT_PORT ||
499 (type == PCI_EXP_TYPE_DOWNSTREAM && 499 (type == PCI_EXP_TYPE_DOWNSTREAM &&
500 dev->pcie_flags_reg & PCI_EXP_FLAGS_SLOT); 500 pcie_caps_reg(dev) & PCI_EXP_FLAGS_SLOT);
501} 501}
502 502
503static inline bool pcie_cap_has_rtctl(const struct pci_dev *dev) 503static inline bool pcie_cap_has_rtctl(const struct pci_dev *dev)
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
index b42133afca98..31063ac30992 100644
--- a/drivers/pci/pcie/portdrv_core.c
+++ b/drivers/pci/pcie/portdrv_core.c
@@ -272,7 +272,7 @@ static int get_port_device_capability(struct pci_dev *dev)
272 272
273 /* Hot-Plug Capable */ 273 /* Hot-Plug Capable */
274 if ((cap_mask & PCIE_PORT_SERVICE_HP) && 274 if ((cap_mask & PCIE_PORT_SERVICE_HP) &&
275 dev->pcie_flags_reg & PCI_EXP_FLAGS_SLOT) { 275 pcie_caps_reg(dev) & PCI_EXP_FLAGS_SLOT) {
276 pcie_capability_read_dword(dev, PCI_EXP_SLTCAP, &reg32); 276 pcie_capability_read_dword(dev, PCI_EXP_SLTCAP, &reg32);
277 if (reg32 & PCI_EXP_SLTCAP_HPC) { 277 if (reg32 & PCI_EXP_SLTCAP_HPC) {
278 services |= PCIE_PORT_SERVICE_HP; 278 services |= PCIE_PORT_SERVICE_HP;
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 78581e1d3f64..63b36281afce 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1707,7 +1707,7 @@ static inline u16 pcie_caps_reg(const struct pci_dev *dev)
1707 */ 1707 */
1708static inline int pci_pcie_type(const struct pci_dev *dev) 1708static inline int pci_pcie_type(const struct pci_dev *dev)
1709{ 1709{
1710 return (dev->pcie_flags_reg & PCI_EXP_FLAGS_TYPE) >> 4; 1710 return (pcie_caps_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4;
1711} 1711}
1712 1712
1713void pci_request_acs(void); 1713void pci_request_acs(void);