]> git.karo-electronics.de Git - linux-beck.git/commitdiff
PCI: altera: Request host bridge window resources with core function
authorBjorn Helgaas <bhelgaas@google.com>
Tue, 31 May 2016 17:14:17 +0000 (12:14 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 20 Jun 2016 19:06:06 +0000 (14:06 -0500)
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>
drivers/pci/host/pcie-altera.c

index dbac6fb3f0bdfbccaaceefc0c1467e80ce0345df..b97abbcdba33fdfcc69018d26f69792d79e6377e 100644 (file)
@@ -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) {