PCI: altera: Request host bridge window resources with core function
Use devm_request_pci_bus_resources() to request host bridge window resources instead of doing it by hand in the driver. No functional change intended. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
parent
9061f9bea4
commit
74462284bd
|
@ -432,21 +432,20 @@ static int altera_pcie_parse_request_of_pci_ranges(struct altera_pcie *pcie)
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
err = devm_request_pci_bus_resources(dev, &pcie->resources);
|
||||||
|
if (err)
|
||||||
|
goto out_release_res;
|
||||||
|
|
||||||
resource_list_for_each_entry(win, &pcie->resources) {
|
resource_list_for_each_entry(win, &pcie->resources) {
|
||||||
struct resource *parent, *res = win->res;
|
struct resource *res = win->res;
|
||||||
|
|
||||||
switch (resource_type(res)) {
|
switch (resource_type(res)) {
|
||||||
case IORESOURCE_MEM:
|
case IORESOURCE_MEM:
|
||||||
parent = &iomem_resource;
|
|
||||||
res_valid |= !(res->flags & IORESOURCE_PREFETCH);
|
res_valid |= !(res->flags & IORESOURCE_PREFETCH);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = devm_request_resource(dev, parent, res);
|
|
||||||
if (err)
|
|
||||||
goto out_release_res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!res_valid) {
|
if (!res_valid) {
|
||||||
|
|
Loading…
Reference in New Issue