Commit 1c531d82 authored by Myron Stowe's avatar Myron Stowe Committed by Bjorn Helgaas

PCI: Use PCI Express Capability accessor

Use PCI Express Capability access functions to simplify device
Capabilities Register usages.
Signed-off-by: default avatarMyron Stowe <myron.stowe@redhat.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 7c9c003c
...@@ -472,7 +472,7 @@ EXPORT_SYMBOL_GPL(pci_cfg_access_unlock); ...@@ -472,7 +472,7 @@ EXPORT_SYMBOL_GPL(pci_cfg_access_unlock);
static inline int pcie_cap_version(const struct pci_dev *dev) static inline int pcie_cap_version(const struct pci_dev *dev)
{ {
return dev->pcie_flags_reg & PCI_EXP_FLAGS_VERS; return pcie_caps_reg(dev) & PCI_EXP_FLAGS_VERS;
} }
static inline bool pcie_cap_has_devctl(const struct pci_dev *dev) static 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,7 +497,7 @@ static inline bool pcie_cap_has_sltctl(const struct pci_dev *dev)
return pcie_cap_version(dev) > 1 || return pcie_cap_version(dev) > 1 ||
type == PCI_EXP_TYPE_ROOT_PORT || type == PCI_EXP_TYPE_ROOT_PORT ||
(type == PCI_EXP_TYPE_DOWNSTREAM && (type == PCI_EXP_TYPE_DOWNSTREAM &&
dev->pcie_flags_reg & PCI_EXP_FLAGS_SLOT); pcie_caps_reg(dev) & PCI_EXP_FLAGS_SLOT);
} }
static inline bool pcie_cap_has_rtctl(const struct pci_dev *dev) static inline bool pcie_cap_has_rtctl(const struct pci_dev *dev)
......
...@@ -272,7 +272,7 @@ static int get_port_device_capability(struct pci_dev *dev) ...@@ -272,7 +272,7 @@ static int get_port_device_capability(struct pci_dev *dev)
/* Hot-Plug Capable */ /* Hot-Plug Capable */
if ((cap_mask & PCIE_PORT_SERVICE_HP) && if ((cap_mask & PCIE_PORT_SERVICE_HP) &&
dev->pcie_flags_reg & PCI_EXP_FLAGS_SLOT) { pcie_caps_reg(dev) & PCI_EXP_FLAGS_SLOT) {
pcie_capability_read_dword(dev, PCI_EXP_SLTCAP, &reg32); pcie_capability_read_dword(dev, PCI_EXP_SLTCAP, &reg32);
if (reg32 & PCI_EXP_SLTCAP_HPC) { if (reg32 & PCI_EXP_SLTCAP_HPC) {
services |= PCIE_PORT_SERVICE_HP; services |= PCIE_PORT_SERVICE_HP;
......
...@@ -1707,7 +1707,7 @@ static inline u16 pcie_caps_reg(const struct pci_dev *dev) ...@@ -1707,7 +1707,7 @@ static inline u16 pcie_caps_reg(const struct pci_dev *dev)
*/ */
static inline int pci_pcie_type(const struct pci_dev *dev) static inline int pci_pcie_type(const struct pci_dev *dev)
{ {
return (dev->pcie_flags_reg & PCI_EXP_FLAGS_TYPE) >> 4; return (pcie_caps_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4;
} }
void pci_request_acs(void); void pci_request_acs(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment