mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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>
This commit is contained in:
parent
6fd7f55097
commit
4c540a35c0
1 changed files with 3 additions and 18 deletions
|
@ -938,11 +938,6 @@ static const struct of_device_id rcar_pcie_of_match[] = {
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(of, 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)
|
static int rcar_pcie_parse_request_of_pci_ranges(struct rcar_pcie *pci)
|
||||||
{
|
{
|
||||||
int err;
|
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) {
|
resource_list_for_each_entry(win, &pci->resources) {
|
||||||
struct resource *res = win->res;
|
struct resource *res = win->res;
|
||||||
|
|
||||||
switch (resource_type(res)) {
|
if (resource_type(res) == IORESOURCE_IO) {
|
||||||
case IORESOURCE_IO:
|
|
||||||
err = pci_remap_iospace(res, iobase);
|
err = pci_remap_iospace(res, iobase);
|
||||||
if (err) {
|
if (err)
|
||||||
dev_warn(dev, "error %d: failed to map resource %pR\n",
|
dev_warn(dev, "error %d: failed to map resource %pR\n",
|
||||||
err, res);
|
err, res);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case IORESOURCE_MEM:
|
|
||||||
break;
|
|
||||||
|
|
||||||
case IORESOURCE_BUS:
|
|
||||||
default:
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_release_res:
|
out_release_res:
|
||||||
rcar_pcie_release_of_pci_ranges(pci);
|
pci_free_resource_list(&pci->resources);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue