From 7c9c003c68de51fb8712a01e904444ef40c742f5 Mon Sep 17 00:00:00 2001 From: Myron Stowe Date: Fri, 25 Jan 2013 17:55:39 -0700 Subject: PCI: Introduce accessor to retrieve PCIe Capabilities Register Provide an accessor to retrieve the PCI Express device's Capabilities Register. Signed-off-by: Myron Stowe Signed-off-by: Bjorn Helgaas --- include/linux/pci.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/linux/pci.h') diff --git a/include/linux/pci.h b/include/linux/pci.h index 15472d691ee6..78581e1d3f64 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1692,6 +1692,15 @@ static inline bool pci_is_pcie(struct pci_dev *dev) return !!pci_pcie_cap(dev); } +/** + * pcie_caps_reg - get the PCIe Capabilities Register + * @dev: PCI device + */ +static inline u16 pcie_caps_reg(const struct pci_dev *dev) +{ + return dev->pcie_flags_reg; +} + /** * pci_pcie_type - get the PCIe device/port type * @dev: PCI device -- cgit v1.2.3 From 1c531d82ee1a220ae7132ba0eb31edaf186b56d1 Mon Sep 17 00:00:00 2001 From: Myron Stowe Date: Fri, 25 Jan 2013 17:55:45 -0700 Subject: PCI: Use PCI Express Capability accessor Use PCI Express Capability access functions to simplify device Capabilities Register usages. Signed-off-by: Myron Stowe Signed-off-by: Bjorn Helgaas --- include/linux/pci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux/pci.h') 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) */ 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); -- cgit v1.2.3