Skip to content

Commit f473182

Browse files
robherringLorenzo Pieralisi
authored andcommitted
PCI: rockchip: Use pci_host_probe() to register host
The rockchip host driver does the same host registration and bus scanning calls as pci_host_probe, so let's use it instead. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Cc: Shawn Lin <[email protected]> Cc: Heiko Stuebner <[email protected]> Cc: [email protected]
1 parent 56d2923 commit f473182

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

drivers/pci/controller/pcie-rockchip-host.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,6 @@ static int rockchip_pcie_probe(struct platform_device *pdev)
949949
{
950950
struct rockchip_pcie *rockchip;
951951
struct device *dev = &pdev->dev;
952-
struct pci_bus *bus, *child;
953952
struct pci_host_bridge *bridge;
954953
struct resource *bus_res;
955954
int err;
@@ -1015,20 +1014,10 @@ static int rockchip_pcie_probe(struct platform_device *pdev)
10151014
bridge->map_irq = of_irq_parse_and_map_pci;
10161015
bridge->swizzle_irq = pci_common_swizzle;
10171016

1018-
err = pci_scan_root_bus_bridge(bridge);
1017+
err = pci_host_probe(bridge);
10191018
if (err < 0)
10201019
goto err_remove_irq_domain;
10211020

1022-
bus = bridge->bus;
1023-
1024-
rockchip->root_bus = bus;
1025-
1026-
pci_bus_size_bridges(bus);
1027-
pci_bus_assign_resources(bus);
1028-
list_for_each_entry(child, &bus->children, node)
1029-
pcie_bus_configure_settings(child);
1030-
1031-
pci_bus_add_devices(bus);
10321021
return 0;
10331022

10341023
err_remove_irq_domain:
@@ -1051,9 +1040,10 @@ static int rockchip_pcie_remove(struct platform_device *pdev)
10511040
{
10521041
struct device *dev = &pdev->dev;
10531042
struct rockchip_pcie *rockchip = dev_get_drvdata(dev);
1043+
struct pci_host_bridge *bridge = pci_host_bridge_from_priv(rockchip);
10541044

1055-
pci_stop_root_bus(rockchip->root_bus);
1056-
pci_remove_root_bus(rockchip->root_bus);
1045+
pci_stop_root_bus(bridge->bus);
1046+
pci_remove_root_bus(bridge->bus);
10571047
irq_domain_remove(rockchip->irq_domain);
10581048

10591049
rockchip_pcie_deinit_phys(rockchip);

drivers/pci/controller/pcie-rockchip.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ struct rockchip_pcie {
303303
struct device *dev;
304304
struct irq_domain *irq_domain;
305305
int offset;
306-
struct pci_bus *root_bus;
307306
void __iomem *msg_region;
308307
phys_addr_t msg_bus_addr;
309308
bool is_rc;

0 commit comments

Comments
 (0)