]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
PCI: Export pcie_find_root_port
authorJohannes Thumshirn <jthumshirn@suse.de>
Wed, 2 Nov 2016 22:35:51 +0000 (16:35 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 23 Nov 2016 22:23:23 +0000 (16:23 -0600)
Export pcie_find_root_port() so we can use it outside of PCIe-AER error
injection.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pcie/aer/aer_inject.c
include/linux/pci.h

index db553dc22c8e0fca49ad98ff2f9fd3111e18918a..2b6a59266689b486c9fe42355af77868086a35b1 100644 (file)
@@ -307,20 +307,6 @@ out:
        return 0;
 }
 
-static struct pci_dev *pcie_find_root_port(struct pci_dev *dev)
-{
-       while (1) {
-               if (!pci_is_pcie(dev))
-                       break;
-               if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT)
-                       return dev;
-               if (!dev->bus->self)
-                       break;
-               dev = dev->bus->self;
-       }
-       return NULL;
-}
-
 static int find_aer_device_iter(struct device *device, void *data)
 {
        struct pcie_device **result = data;
index 0e49f70dbd9b0aaf48d8546d2765f7c4fe813012..a38772a855885e48e0fc5a5f83c942efc9d9db4c 100644 (file)
@@ -1928,6 +1928,20 @@ static inline int pci_pcie_type(const struct pci_dev *dev)
        return (pcie_caps_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4;
 }
 
+static inline struct pci_dev *pcie_find_root_port(struct pci_dev *dev)
+{
+       while (1) {
+               if (!pci_is_pcie(dev))
+                       break;
+               if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT)
+                       return dev;
+               if (!dev->bus->self)
+                       break;
+               dev = dev->bus->self;
+       }
+       return NULL;
+}
+
 void pci_request_acs(void);
 bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags);
 bool pci_acs_path_enabled(struct pci_dev *start,