summaryrefslogtreecommitdiff
path: root/drivers/pci/host/pcie-rcar.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2016-05-28 18:37:46 -0500
committerBjorn Helgaas <bhelgaas@google.com>2016-06-25 07:44:23 -0500
commit4c540a35c06963fa853a14daaf9a4f7df39856d5 (patch)
treedbf13fd52f35046281e9d4ede0ab446cacb3a82e /drivers/pci/host/pcie-rcar.c
parent6fd7f550975a2186493dbea6170acbe7da3b8ab9 (diff)
PCI: rcar: Simplify host bridge window iteration
The switch is the only statement in the resource_list_for_each_entry() loop, so remove unnecessary cases and "continue" statements in the switch. Inline rcar_pcie_release_of_pci_ranges(), which is only called once. No functional change intended. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/host/pcie-rcar.c')
-rw-r--r--drivers/pci/host/pcie-rcar.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index ce096db38af4..6546ca79f188 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -938,11 +938,6 @@ static const struct of_device_id rcar_pcie_of_match[] = {
};
MODULE_DEVICE_TABLE(of, rcar_pcie_of_match);
-static void rcar_pcie_release_of_pci_ranges(struct rcar_pcie *pci)
-{
- pci_free_resource_list(&pci->resources);
-}
-
static int rcar_pcie_parse_request_of_pci_ranges(struct rcar_pcie *pci)
{
int err;
@@ -962,28 +957,18 @@ static int rcar_pcie_parse_request_of_pci_ranges(struct rcar_pcie *pci)
resource_list_for_each_entry(win, &pci->resources) {
struct resource *res = win->res;
- switch (resource_type(res)) {
- case IORESOURCE_IO:
+ if (resource_type(res) == IORESOURCE_IO) {
err = pci_remap_iospace(res, iobase);
- if (err) {
+ if (err)
dev_warn(dev, "error %d: failed to map resource %pR\n",
err, res);
- continue;
- }
- break;
- case IORESOURCE_MEM:
- break;
-
- case IORESOURCE_BUS:
- default:
- continue;
}
}
return 0;
out_release_res:
- rcar_pcie_release_of_pci_ranges(pci);
+ pci_free_resource_list(&pci->resources);
return err;
}