aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2016-05-28 19:37:46 -0400
committerBjorn Helgaas <bhelgaas@google.com>2016-06-25 08:44:23 -0400
commit4c540a35c06963fa853a14daaf9a4f7df39856d5 (patch)
treedbf13fd52f35046281e9d4ede0ab446cacb3a82e
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>
-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[] = {
938}; 938};
939MODULE_DEVICE_TABLE(of, rcar_pcie_of_match); 939MODULE_DEVICE_TABLE(of, rcar_pcie_of_match);
940 940
941static void rcar_pcie_release_of_pci_ranges(struct rcar_pcie *pci)
942{
943 pci_free_resource_list(&pci->resources);
944}
945
946static int rcar_pcie_parse_request_of_pci_ranges(struct rcar_pcie *pci) 941static int rcar_pcie_parse_request_of_pci_ranges(struct rcar_pcie *pci)
947{ 942{
948 int err; 943 int err;
@@ -962,28 +957,18 @@ static int rcar_pcie_parse_request_of_pci_ranges(struct rcar_pcie *pci)
962 resource_list_for_each_entry(win, &pci->resources) { 957 resource_list_for_each_entry(win, &pci->resources) {
963 struct resource *res = win->res; 958 struct resource *res = win->res;
964 959
965 switch (resource_type(res)) { 960 if (resource_type(res) == IORESOURCE_IO) {
966 case IORESOURCE_IO:
967 err = pci_remap_iospace(res, iobase); 961 err = pci_remap_iospace(res, iobase);
968 if (err) { 962 if (err)
969 dev_warn(dev, "error %d: failed to map resource %pR\n", 963 dev_warn(dev, "error %d: failed to map resource %pR\n",
970 err, res); 964 err, res);
971 continue;
972 }
973 break;
974 case IORESOURCE_MEM:
975 break;
976
977 case IORESOURCE_BUS:
978 default:
979 continue;
980 } 965 }
981 } 966 }
982 967
983 return 0; 968 return 0;
984 969
985out_release_res: 970out_release_res:
986 rcar_pcie_release_of_pci_ranges(pci); 971 pci_free_resource_list(&pci->resources);
987 return err; 972 return err;
988} 973}
989 974