summaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2016-05-31 12:09:28 -0500
committerBjorn Helgaas <bhelgaas@google.com>2016-06-25 07:44:24 -0500
commit2fbb353041891ce8527667ca956d9c53222dec01 (patch)
tree30bd9ff3fb5eb27acf7d79ea2cabcf17ce3f2551 /drivers/pci
parent45c64b6ac4ef0f50ba754e997585c02b10c93c02 (diff)
downloadlinux-stable-2fbb353041891ce8527667ca956d9c53222dec01.tar.gz
linux-stable-2fbb353041891ce8527667ca956d9c53222dec01.tar.bz2
linux-stable-2fbb353041891ce8527667ca956d9c53222dec01.zip
PCI: versatile: 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')
-rw-r--r--drivers/pci/host/pci-versatile.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/pci/host/pci-versatile.c b/drivers/pci/host/pci-versatile.c
index f843a72dc51c..273edaca8f49 100644
--- a/drivers/pci/host/pci-versatile.c
+++ b/drivers/pci/host/pci-versatile.c
@@ -80,12 +80,15 @@ static int versatile_pci_parse_request_of_pci_ranges(struct device *dev,
if (err)
return err;
+ err = devm_request_pci_bus_resources(dev, res);
+ if (err)
+ goto out_release_res;
+
resource_list_for_each_entry(win, res) {
- struct resource *parent, *res = win->res;
+ struct resource *res = win->res;
switch (resource_type(res)) {
case IORESOURCE_IO:
- parent = &ioport_resource;
err = pci_remap_iospace(res, iobase);
if (err) {
dev_warn(dev, "error %d: failed to map resource %pR\n",
@@ -94,7 +97,6 @@ static int versatile_pci_parse_request_of_pci_ranges(struct device *dev,
}
break;
case IORESOURCE_MEM:
- parent = &iomem_resource;
res_valid |= !(res->flags & IORESOURCE_PREFETCH);
writel(res->start >> 28, PCI_IMAP(mem));
@@ -106,10 +108,6 @@ static int versatile_pci_parse_request_of_pci_ranges(struct device *dev,
default:
continue;
}
-
- err = devm_request_resource(dev, parent, res);
- if (err)
- goto out_release_res;
}
if (!res_valid) {