]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
PCI: Move pci_hp_add_bridge() to drivers/pci/probe.c
authorMika Westerberg <mika.westerberg@linux.intel.com>
Fri, 13 Oct 2017 18:35:41 +0000 (21:35 +0300)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 7 Nov 2017 00:48:58 +0000 (18:48 -0600)
There is not much point of having a file with a single function in it.
Instead we can just move pci_hp_add_bridge() to drivers/pci/probe.c and
make it available always when PCI core is enabled.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
[bhelgaas: convert printk to dev_err()]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/Makefile
drivers/pci/hotplug-pci.c [deleted file]
drivers/pci/probe.c

index 66a21acad95288be33076a9386359546e094dc20..fa56267fa2c0e49e17a435a9a6b628e8590effbd 100644 (file)
@@ -16,9 +16,6 @@ obj-$(CONFIG_PCIEPORTBUS) += pcie/
 
 # Build the PCI Hotplug drivers if we were asked to
 obj-$(CONFIG_HOTPLUG_PCI) += hotplug/
-ifdef CONFIG_HOTPLUG_PCI
-obj-y += hotplug-pci.o
-endif
 
 # Build the PCI MSI interrupt support
 obj-$(CONFIG_PCI_MSI) += msi.o
diff --git a/drivers/pci/hotplug-pci.c b/drivers/pci/hotplug-pci.c
deleted file mode 100644 (file)
index c68366c..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Core PCI functionality used only by PCI hotplug */
-
-#include <linux/pci.h>
-#include <linux/export.h>
-#include "pci.h"
-
-int pci_hp_add_bridge(struct pci_dev *dev)
-{
-       struct pci_bus *parent = dev->bus;
-       int pass, busnr, start = parent->busn_res.start;
-       int end = parent->busn_res.end;
-
-       for (busnr = start; busnr <= end; busnr++) {
-               if (!pci_find_bus(pci_domain_nr(parent), busnr))
-                       break;
-       }
-       if (busnr-- > end) {
-               printk(KERN_ERR "No bus number available for hot-added bridge %s\n",
-                               pci_name(dev));
-               return -1;
-       }
-       for (pass = 0; pass < 2; pass++)
-               busnr = pci_scan_bridge(parent, dev, busnr, pass);
-       if (!dev->subordinate)
-               return -1;
-
-       return 0;
-}
-EXPORT_SYMBOL_GPL(pci_hp_add_bridge);
index cdc2f83c11c5a0855a27bb0e7d44ca28d52626bc..62d45a76f663bedda6c9bd8ee2d91c4d4fea587d 100644 (file)
@@ -2735,3 +2735,26 @@ void __init pci_sort_breadthfirst(void)
 {
        bus_sort_breadthfirst(&pci_bus_type, &pci_sort_bf_cmp);
 }
+
+int pci_hp_add_bridge(struct pci_dev *dev)
+{
+       struct pci_bus *parent = dev->bus;
+       int pass, busnr, start = parent->busn_res.start;
+       int end = parent->busn_res.end;
+
+       for (busnr = start; busnr <= end; busnr++) {
+               if (!pci_find_bus(pci_domain_nr(parent), busnr))
+                       break;
+       }
+       if (busnr-- > end) {
+               dev_err(&dev->dev, "No bus number available for hot-added bridge\n");
+               return -1;
+       }
+       for (pass = 0; pass < 2; pass++)
+               busnr = pci_scan_bridge(parent, dev, busnr, pass);
+       if (!dev->subordinate)
+               return -1;
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(pci_hp_add_bridge);