PCI: rcar: Use devm_pci_alloc_host_bridge()

Move to the resource managed devm_pci_alloc_host_bridge() and simplify
the error path.

Link: https://lore.kernel.org/r/20200722022514.1283916-15-robh@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-renesas-soc@vger.kernel.org
This commit is contained in:
Rob Herring 2020-07-21 20:25:09 -06:00 committed by Lorenzo Pieralisi
parent ec64e27959
commit 61f11f8250
1 changed files with 2 additions and 5 deletions

View File

@ -940,7 +940,7 @@ static int rcar_pcie_probe(struct platform_device *pdev)
int err; int err;
struct pci_host_bridge *bridge; struct pci_host_bridge *bridge;
bridge = pci_alloc_host_bridge(sizeof(*host)); bridge = devm_pci_alloc_host_bridge(dev, sizeof(*host));
if (!bridge) if (!bridge)
return -ENOMEM; return -ENOMEM;
@ -952,7 +952,7 @@ static int rcar_pcie_probe(struct platform_device *pdev)
err = pci_parse_request_of_pci_ranges(dev, &host->resources, err = pci_parse_request_of_pci_ranges(dev, &host->resources,
&bridge->dma_ranges, NULL); &bridge->dma_ranges, NULL);
if (err) if (err)
goto err_free_bridge; return err;
pm_runtime_enable(pcie->dev); pm_runtime_enable(pcie->dev);
err = pm_runtime_get_sync(pcie->dev); err = pm_runtime_get_sync(pcie->dev);
@ -1034,9 +1034,6 @@ static int rcar_pcie_probe(struct platform_device *pdev)
pm_runtime_disable(dev); pm_runtime_disable(dev);
pci_free_resource_list(&host->resources); pci_free_resource_list(&host->resources);
err_free_bridge:
pci_free_host_bridge(bridge);
return err; return err;
} }