diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2016-05-31 19:14:17 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-06-20 21:06:06 +0200 |
commit | 74462284bdda85216c3cf49d52920d4164f47e80 (patch) | |
tree | 7ad123346ba6763f6dd0d1a04839cdd8b2b7761d /drivers/pci/host/pcie-altera.c | |
parent | PCI: xilinx-nwl: Use dev_printk() when possible (diff) | |
download | linux-74462284bdda85216c3cf49d52920d4164f47e80.tar.xz linux-74462284bdda85216c3cf49d52920d4164f47e80.zip |
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>
Diffstat (limited to 'drivers/pci/host/pcie-altera.c')
-rw-r--r-- | drivers/pci/host/pcie-altera.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c index dbac6fb3f0bd..b97abbcdba33 100644 --- a/drivers/pci/host/pcie-altera.c +++ b/drivers/pci/host/pcie-altera.c @@ -432,21 +432,20 @@ static int altera_pcie_parse_request_of_pci_ranges(struct altera_pcie *pcie) if (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) { - struct resource *parent, *res = win->res; + struct resource *res = win->res; switch (resource_type(res)) { case IORESOURCE_MEM: - parent = &iomem_resource; res_valid |= !(res->flags & IORESOURCE_PREFETCH); break; default: continue; } - - err = devm_request_resource(dev, parent, res); - if (err) - goto out_release_res; } if (!res_valid) { |