Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 95e3ba97 authored by Mika Westerberg's avatar Mika Westerberg Committed by Bjorn Helgaas
Browse files

PCI: Move pci_hp_add_bridge() to drivers/pci/probe.c



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: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
[bhelgaas: convert printk to dev_err()]
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 24a0c654
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -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

drivers/pci/hotplug-pci.c

deleted100644 → 0
+0 −29
Original line number Diff line number Diff line
/* 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);
+23 −0
Original line number Diff line number Diff line
@@ -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);