Skip to content

Commit 3c65ebf

Browse files
robherringLorenzo Pieralisi
authored andcommitted
PCI: xilinx-nwl: Use pci_parse_request_of_pci_ranges()
Convert the xilinx-nwl host bridge to use the common pci_parse_request_of_pci_ranges(). There's no need to assign the resources to a temporary list first. Just use bridge->windows directly and remove all the temporary list handling. Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Cc: Lorenzo Pieralisi <[email protected]> Cc: Andrew Murray <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Michal Simek <[email protected]>
1 parent ee352c2 commit 3c65ebf

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

drivers/pci/controller/pcie-xilinx-nwl.c

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -821,8 +821,6 @@ static int nwl_pcie_probe(struct platform_device *pdev)
821821
struct pci_bus *child;
822822
struct pci_host_bridge *bridge;
823823
int err;
824-
resource_size_t iobase = 0;
825-
LIST_HEAD(res);
826824

827825
bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie));
828826
if (!bridge)
@@ -845,24 +843,18 @@ static int nwl_pcie_probe(struct platform_device *pdev)
845843
return err;
846844
}
847845

848-
err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &res,
849-
&iobase);
846+
err = pci_parse_request_of_pci_ranges(dev, &bridge->windows, NULL);
850847
if (err) {
851848
dev_err(dev, "Getting bridge resources failed\n");
852849
return err;
853850
}
854851

855-
err = devm_request_pci_bus_resources(dev, &res);
856-
if (err)
857-
goto error;
858-
859852
err = nwl_pcie_init_irq_domain(pcie);
860853
if (err) {
861854
dev_err(dev, "Failed creating IRQ Domain\n");
862-
goto error;
855+
return err;
863856
}
864857

865-
list_splice_init(&res, &bridge->windows);
866858
bridge->dev.parent = dev;
867859
bridge->sysdata = pcie;
868860
bridge->busnr = pcie->root_busno;
@@ -874,13 +866,13 @@ static int nwl_pcie_probe(struct platform_device *pdev)
874866
err = nwl_pcie_enable_msi(pcie);
875867
if (err < 0) {
876868
dev_err(dev, "failed to enable MSI support: %d\n", err);
877-
goto error;
869+
return err;
878870
}
879871
}
880872

881873
err = pci_scan_root_bus_bridge(bridge);
882874
if (err)
883-
goto error;
875+
return err;
884876

885877
bus = bridge->bus;
886878

@@ -889,10 +881,6 @@ static int nwl_pcie_probe(struct platform_device *pdev)
889881
pcie_bus_configure_settings(child);
890882
pci_bus_add_devices(bus);
891883
return 0;
892-
893-
error:
894-
pci_free_resource_list(&res);
895-
return err;
896884
}
897885

898886
static struct platform_driver nwl_pcie_driver = {

0 commit comments

Comments
 (0)