Skip to content

Commit 81ce3cf

Browse files
robherringLorenzo Pieralisi
authored andcommitted
PCI: iproc: Use pci_host_probe() to register host
The iproc host driver does the same host registration and bus scanning calls as pci_host_probe, so let's use it instead. The only difference is pci_assign_unassigned_bus_resources() was called instead of pci_bus_size_bridges() and pci_bus_assign_resources(). This should be the same. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Acked-by: Scott Branden <[email protected]> Cc: Lorenzo Pieralisi <[email protected]> Cc: Ray Jui <[email protected]> Cc: Scott Branden <[email protected]> Cc: [email protected]
1 parent c63aed7 commit 81ce3cf

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

drivers/pci/controller/pcie-iproc.c

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,6 @@ int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res)
14701470
{
14711471
struct device *dev;
14721472
int ret;
1473-
struct pci_bus *child;
14741473
struct pci_host_bridge *host = pci_host_bridge_from_priv(pcie);
14751474

14761475
dev = pcie->dev;
@@ -1531,21 +1530,12 @@ int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res)
15311530
host->map_irq = pcie->map_irq;
15321531
host->swizzle_irq = pci_common_swizzle;
15331532

1534-
ret = pci_scan_root_bus_bridge(host);
1533+
ret = pci_host_probe(host);
15351534
if (ret < 0) {
15361535
dev_err(dev, "failed to scan host: %d\n", ret);
15371536
goto err_power_off_phy;
15381537
}
15391538

1540-
pci_assign_unassigned_bus_resources(host->bus);
1541-
1542-
pcie->root_bus = host->bus;
1543-
1544-
list_for_each_entry(child, &host->bus->children, node)
1545-
pcie_bus_configure_settings(child);
1546-
1547-
pci_bus_add_devices(host->bus);
1548-
15491539
return 0;
15501540

15511541
err_power_off_phy:
@@ -1558,8 +1548,10 @@ EXPORT_SYMBOL(iproc_pcie_setup);
15581548

15591549
int iproc_pcie_remove(struct iproc_pcie *pcie)
15601550
{
1561-
pci_stop_root_bus(pcie->root_bus);
1562-
pci_remove_root_bus(pcie->root_bus);
1551+
struct pci_host_bridge *host = pci_host_bridge_from_priv(pcie);
1552+
1553+
pci_stop_root_bus(host->bus);
1554+
pci_remove_root_bus(host->bus);
15631555

15641556
iproc_pcie_msi_disable(pcie);
15651557

drivers/pci/controller/pcie-iproc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ struct iproc_msi;
5454
* @reg_offsets: register offsets
5555
* @base: PCIe host controller I/O register base
5656
* @base_addr: PCIe host controller register base physical address
57-
* @root_bus: pointer to root bus
5857
* @phy: optional PHY device that controls the Serdes
5958
* @map_irq: function callback to map interrupts
6059
* @ep_is_internal: indicates an internal emulated endpoint device is connected
@@ -85,7 +84,6 @@ struct iproc_pcie {
8584
void __iomem *base;
8685
phys_addr_t base_addr;
8786
struct resource mem;
88-
struct pci_bus *root_bus;
8987
struct phy *phy;
9088
int (*map_irq)(const struct pci_dev *, u8, u8);
9189
bool ep_is_internal;

0 commit comments

Comments
 (0)