summaryrefslogtreecommitdiff
path: root/drivers/pci/controller/pcie-rockchip-host.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2020-05-23 02:48:30 +0300
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2020-07-10 13:50:23 +0300
commitf473182c7524ddc04b5fc0aeb246ac102cf6edb5 (patch)
tree8a7369804a10e327e49b9038df9a7b6c2d7a1414 /drivers/pci/controller/pcie-rockchip-host.c
parent56d2923484704a261f91f5fd0d4dd35f5b3ebb19 (diff)
downloadlinux-f473182c7524ddc04b5fc0aeb246ac102cf6edb5.tar.xz
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/20200522234832.954484-14-robh@kernel.org Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Shawn Lin <shawn.lin@rock-chips.com> Cc: Heiko Stuebner <heiko@sntech.de> Cc: linux-rockchip@lists.infradead.org
Diffstat (limited to 'drivers/pci/controller/pcie-rockchip-host.c')
-rw-r--r--drivers/pci/controller/pcie-rockchip-host.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/pci/controller/pcie-rockchip-host.c b/drivers/pci/controller/pcie-rockchip-host.c
index 94af6f5828a3..6a3c8442258b 100644
--- a/drivers/pci/controller/pcie-rockchip-host.c
+++ b/drivers/pci/controller/pcie-rockchip-host.c
@@ -949,7 +949,6 @@ static int rockchip_pcie_probe(struct platform_device *pdev)
{
struct rockchip_pcie *rockchip;
struct device *dev = &pdev->dev;
- struct pci_bus *bus, *child;
struct pci_host_bridge *bridge;
struct resource *bus_res;
int err;
@@ -1015,20 +1014,10 @@ static int rockchip_pcie_probe(struct platform_device *pdev)
bridge->map_irq = of_irq_parse_and_map_pci;
bridge->swizzle_irq = pci_common_swizzle;
- err = pci_scan_root_bus_bridge(bridge);
+ err = pci_host_probe(bridge);
if (err < 0)
goto err_remove_irq_domain;
- bus = bridge->bus;
-
- rockchip->root_bus = bus;
-
- 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;
err_remove_irq_domain:
@@ -1051,9 +1040,10 @@ static int rockchip_pcie_remove(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct rockchip_pcie *rockchip = dev_get_drvdata(dev);
+ struct pci_host_bridge *bridge = pci_host_bridge_from_priv(rockchip);
- pci_stop_root_bus(rockchip->root_bus);
- pci_remove_root_bus(rockchip->root_bus);
+ pci_stop_root_bus(bridge->bus);
+ pci_remove_root_bus(bridge->bus);
irq_domain_remove(rockchip->irq_domain);
rockchip_pcie_deinit_phys(rockchip);