Skip to content

Commit 61f11f8

Browse files
robherringLorenzo Pieralisi
authored andcommitted
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/[email protected] Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Cc: Marek Vasut <[email protected]> Cc: Yoshihiro Shimoda <[email protected]> Cc: Lorenzo Pieralisi <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: [email protected]
1 parent ec64e27 commit 61f11f8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/pci/controller/pcie-rcar-host.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ static int rcar_pcie_probe(struct platform_device *pdev)
940940
int err;
941941
struct pci_host_bridge *bridge;
942942

943-
bridge = pci_alloc_host_bridge(sizeof(*host));
943+
bridge = devm_pci_alloc_host_bridge(dev, sizeof(*host));
944944
if (!bridge)
945945
return -ENOMEM;
946946

@@ -952,7 +952,7 @@ static int rcar_pcie_probe(struct platform_device *pdev)
952952
err = pci_parse_request_of_pci_ranges(dev, &host->resources,
953953
&bridge->dma_ranges, NULL);
954954
if (err)
955-
goto err_free_bridge;
955+
return err;
956956

957957
pm_runtime_enable(pcie->dev);
958958
err = pm_runtime_get_sync(pcie->dev);
@@ -1034,9 +1034,6 @@ static int rcar_pcie_probe(struct platform_device *pdev)
10341034
pm_runtime_disable(dev);
10351035
pci_free_resource_list(&host->resources);
10361036

1037-
err_free_bridge:
1038-
pci_free_host_bridge(bridge);
1039-
10401037
return err;
10411038
}
10421039

0 commit comments

Comments
 (0)