diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2018-01-31 10:21:33 -0600 |
---|---|---|
committer | Bjorn Helgaas <helgaas@kernel.org> | 2018-01-31 10:21:33 -0600 |
commit | c7f75aecb2d9436c4bef8b413231f60deae3453c (patch) | |
tree | ad6082d4a0d79226637af66ee8f2fc4b24590d4b /drivers/pci/probe.c | |
parent | a07ae842e209196ffe0fe8feacd489aba772d8a0 (diff) | |
parent | 37dddf14f1aecd9fa89a5136b38b33cab54b9195 (diff) | |
download | linux-c7f75aecb2d9436c4bef8b413231f60deae3453c.tar.bz2 |
Merge remote-tracking branch 'lorenzo/pci/cadence' into next
* lorenzo/pci/cadence:
PCI: cadence: Add EndPoint Controller driver for Cadence PCIe controller
dt-bindings: PCI: cadence: Add DT bindings for Cadence PCIe endpoint controller
PCI: endpoint: Fix EPF device name to support multi-function devices
PCI: endpoint: Add the function number as argument to EPC ops
PCI: cadence: Add host driver for Cadence PCIe controller
dt-bindings: PCI: cadence: Add DT bindings for Cadence PCIe host controller
PCI: Add vendor ID for Cadence
PCI: Add generic function to probe PCI host controllers
PCI: generic: fix missing call of pci_free_resource_list()
PCI: OF: Add generic function to parse and allocate PCI resources
PCI: Regroup all PCI related entries into drivers/pci/Makefile
Conflicts:
drivers/pci/of.c
include/linux/pci.h
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r-- | drivers/pci/probe.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 2c673a65d5b0..708785e5871f 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2684,6 +2684,39 @@ err_out: } EXPORT_SYMBOL_GPL(pci_create_root_bus); +int pci_host_probe(struct pci_host_bridge *bridge) +{ + struct pci_bus *bus, *child; + int ret; + + ret = pci_scan_root_bus_bridge(bridge); + if (ret < 0) { + dev_err(bridge->dev.parent, "Scanning root bridge failed"); + return ret; + } + + bus = bridge->bus; + + /* + * We insert PCI resources into the iomem_resource and + * ioport_resource trees in either pci_bus_claim_resources() + * or pci_bus_assign_resources(). + */ + if (pci_has_flag(PCI_PROBE_ONLY)) { + pci_bus_claim_resources(bus); + } else { + pci_bus_size_bridges(bus); + pci_bus_assign_resources(bus); + + list_for_each_entry(child, &bus->children, node) + pcie_bus_configure_settings(child); + } + + pci_bus_add_devices(bus); + return 0; +} +EXPORT_SYMBOL_GPL(pci_host_probe); + int pci_bus_insert_busn_res(struct pci_bus *b, int bus, int bus_max) { struct resource *res = &b->busn_res; |