diff mbox series

[15/15] PCI: xilinx: Use pci_host_probe() to register host

Message ID 20200522234832.954484-16-robh@kernel.org (mailing list archive)
State New, archived
Headers show
Series PCI controller probe cleanups | expand

Commit Message

Rob Herring (Arm) May 22, 2020, 11:48 p.m. UTC
The xilinx 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.

Cc: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/pci/controller/pcie-xilinx.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Comments

Michal Simek May 25, 2020, 6:44 a.m. UTC | #1
On 23. 05. 20 1:48, Rob Herring wrote:
> The xilinx 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.
> 
> Cc: Michal Simek <michal.simek@xilinx.com>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/pci/controller/pcie-xilinx.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/drivers/pci/controller/pcie-xilinx.c b/drivers/pci/controller/pcie-xilinx.c
> index 98e55297815b..05547497f391 100644
> --- a/drivers/pci/controller/pcie-xilinx.c
> +++ b/drivers/pci/controller/pcie-xilinx.c
> @@ -616,7 +616,6 @@ static int xilinx_pcie_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
>  	struct xilinx_pcie_port *port;
> -	struct pci_bus *bus, *child;
>  	struct pci_host_bridge *bridge;
>  	int err;
>  
> @@ -663,17 +662,7 @@ static int xilinx_pcie_probe(struct platform_device *pdev)
>  	xilinx_pcie_msi_chip.dev = dev;
>  	bridge->msi = &xilinx_pcie_msi_chip;
>  #endif
> -	err = pci_scan_root_bus_bridge(bridge);
> -	if (err < 0)
> -		return err;
> -
> -	bus = bridge->bus;
> -
> -	pci_assign_unassigned_bus_resources(bus);
> -	list_for_each_entry(child, &bus->children, node)
> -		pcie_bus_configure_settings(child);
> -	pci_bus_add_devices(bus);
> -	return 0;
> +	return pci_host_probe(bridge);
>  }
>  
>  static const struct of_device_id xilinx_pcie_of_match[] = {
> 


Bharat: Please review.

Thanks,
Michal
diff mbox series

Patch

diff --git a/drivers/pci/controller/pcie-xilinx.c b/drivers/pci/controller/pcie-xilinx.c
index 98e55297815b..05547497f391 100644
--- a/drivers/pci/controller/pcie-xilinx.c
+++ b/drivers/pci/controller/pcie-xilinx.c
@@ -616,7 +616,6 @@  static int xilinx_pcie_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct xilinx_pcie_port *port;
-	struct pci_bus *bus, *child;
 	struct pci_host_bridge *bridge;
 	int err;
 
@@ -663,17 +662,7 @@  static int xilinx_pcie_probe(struct platform_device *pdev)
 	xilinx_pcie_msi_chip.dev = dev;
 	bridge->msi = &xilinx_pcie_msi_chip;
 #endif
-	err = pci_scan_root_bus_bridge(bridge);
-	if (err < 0)
-		return err;
-
-	bus = bridge->bus;
-
-	pci_assign_unassigned_bus_resources(bus);
-	list_for_each_entry(child, &bus->children, node)
-		pcie_bus_configure_settings(child);
-	pci_bus_add_devices(bus);
-	return 0;
+	return pci_host_probe(bridge);
 }
 
 static const struct of_device_id xilinx_pcie_of_match[] = {