Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: Make pci_register_host_bridge() PCI core internal

With the introduction of pci_scan_root_bus_bridge() there is no need to
export pci_register_host_bridge() to other kernel subsystems other than the
PCI compilation unit that needs it.

Make pci_register_host_bridge() static to its compilation unit and convert
the existing drivers usage over to pci_scan_root_bus_bridge().

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Arnd Bergmann <arnd@arndb.de>

authored by

Lorenzo Pieralisi and committed by
Bjorn Helgaas
cea9bc0b 1228c4b6

+4 -9
+2 -3
drivers/pci/host/pci-ftpci100.c
··· 527 527 return ret; 528 528 529 529 list_splice_init(&res, &host->windows); 530 - ret = pci_register_host_bridge(host); 530 + ret = pci_scan_root_bus_bridge(host); 531 531 if (ret) { 532 - dev_err(dev, "failed to register host: %d\n", ret); 532 + dev_err(dev, "failed to scan host: %d\n", ret); 533 533 return ret; 534 534 } 535 535 p->bus = host->bus; 536 536 537 - pci_scan_child_bus(p->bus); 538 537 pci_fixup_irqs(pci_common_swizzle, of_irq_parse_and_map_pci); 539 538 pci_bus_assign_resources(p->bus); 540 539 pci_bus_add_devices(p->bus);
+1 -3
drivers/pci/host/pci-tegra.c
··· 2285 2285 host->dev.parent = &pdev->dev; 2286 2286 host->ops = &tegra_pcie_ops; 2287 2287 2288 - err = pci_register_host_bridge(host); 2288 + err = pci_scan_root_bus_bridge(host); 2289 2289 if (err < 0) { 2290 2290 dev_err(dev, "failed to register host: %d\n", err); 2291 2291 goto disable_msi; 2292 2292 } 2293 - 2294 - pci_scan_child_bus(host->bus); 2295 2293 2296 2294 pci_fixup_irqs(pci_common_swizzle, tegra_pcie_map_irq); 2297 2295 pci_bus_size_bridges(host->bus);
+1 -2
drivers/pci/probe.c
··· 746 746 dev_set_msi_domain(&bus->dev, d); 747 747 } 748 748 749 - int pci_register_host_bridge(struct pci_host_bridge *bridge) 749 + static int pci_register_host_bridge(struct pci_host_bridge *bridge) 750 750 { 751 751 struct device *parent = bridge->dev.parent; 752 752 struct resource_entry *window, *n; ··· 861 861 kfree(bus); 862 862 return err; 863 863 } 864 - EXPORT_SYMBOL(pci_register_host_bridge); 865 864 866 865 static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent, 867 866 struct pci_dev *bridge, int busnr)
-1
include/linux/pci.h
··· 461 461 struct pci_host_bridge *devm_pci_alloc_host_bridge(struct device *dev, 462 462 size_t priv); 463 463 void pci_free_host_bridge(struct pci_host_bridge *bridge); 464 - int pci_register_host_bridge(struct pci_host_bridge *bridge); 465 464 struct pci_host_bridge *pci_find_host_bridge(struct pci_bus *bus); 466 465 467 466 void pci_set_host_bridge_release(struct pci_host_bridge *bridge,