Skip to content

Commit ee352c2

Browse files
robherringLorenzo Pieralisi
authored andcommitted
PCI: xilinx: Use pci_parse_request_of_pci_ranges()
Convert the Xilinx 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 83083e2 commit ee352c2

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

drivers/pci/controller/pcie-xilinx.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,6 @@ static int xilinx_pcie_probe(struct platform_device *pdev)
619619
struct pci_bus *bus, *child;
620620
struct pci_host_bridge *bridge;
621621
int err;
622-
resource_size_t iobase = 0;
623-
LIST_HEAD(res);
624622

625623
if (!dev->of_node)
626624
return -ENODEV;
@@ -647,19 +645,12 @@ static int xilinx_pcie_probe(struct platform_device *pdev)
647645
return err;
648646
}
649647

650-
err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &res,
651-
&iobase);
648+
err = pci_parse_request_of_pci_ranges(dev, &bridge->windows, NULL);
652649
if (err) {
653650
dev_err(dev, "Getting bridge resources failed\n");
654651
return err;
655652
}
656653

657-
err = devm_request_pci_bus_resources(dev, &res);
658-
if (err)
659-
goto error;
660-
661-
662-
list_splice_init(&res, &bridge->windows);
663654
bridge->dev.parent = dev;
664655
bridge->sysdata = port;
665656
bridge->busnr = 0;
@@ -673,7 +664,7 @@ static int xilinx_pcie_probe(struct platform_device *pdev)
673664
#endif
674665
err = pci_scan_root_bus_bridge(bridge);
675666
if (err < 0)
676-
goto error;
667+
return err;
677668

678669
bus = bridge->bus;
679670

@@ -682,10 +673,6 @@ static int xilinx_pcie_probe(struct platform_device *pdev)
682673
pcie_bus_configure_settings(child);
683674
pci_bus_add_devices(bus);
684675
return 0;
685-
686-
error:
687-
pci_free_resource_list(&res);
688-
return err;
689676
}
690677

691678
static const struct of_device_id xilinx_pcie_of_match[] = {

0 commit comments

Comments
 (0)