diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2018-05-15 11:07:05 +0200 |
---|---|---|
committer | Bjorn Helgaas <helgaas@kernel.org> | 2018-05-30 11:35:13 -0500 |
commit | 5bd51b35c7cbbc98786282ada940429a33b52e17 (patch) | |
tree | 8074a74b42e82024cce8ad51c2cce56f05db275a /drivers/pci/host | |
parent | d9c5d5ac287caaa1bc17406ee16ce20f124e5583 (diff) | |
download | linux-stable-5bd51b35c7cbbc98786282ada940429a33b52e17.tar.gz linux-stable-5bd51b35c7cbbc98786282ada940429a33b52e17.tar.bz2 linux-stable-5bd51b35c7cbbc98786282ada940429a33b52e17.zip |
PCI: Rework of_pci_get_host_bridge_resources() to devm_of_pci_get_host_bridge_resources()
of_pci_get_host_bridge_resources() allocates the resource structures it
fills dynamically, but none of its callers care to release them so far.
Rather than requiring everyone to do this explicitly, convert the existing
function to a managed version.
Tested-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Acked-by: Joao Pinto <jpinto@synopsys.com>
Acked-by: Jingoo Han <jingoohan1@gmail.com>
CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Diffstat (limited to 'drivers/pci/host')
-rw-r--r-- | drivers/pci/host/pci-aardvark.c | 2 | ||||
-rw-r--r-- | drivers/pci/host/pci-ftpci100.c | 2 | ||||
-rw-r--r-- | drivers/pci/host/pci-v3-semi.c | 2 | ||||
-rw-r--r-- | drivers/pci/host/pci-versatile.c | 2 | ||||
-rw-r--r-- | drivers/pci/host/pci-xgene.c | 2 | ||||
-rw-r--r-- | drivers/pci/host/pcie-altera.c | 2 | ||||
-rw-r--r-- | drivers/pci/host/pcie-iproc-platform.c | 2 | ||||
-rw-r--r-- | drivers/pci/host/pcie-rcar.c | 2 | ||||
-rw-r--r-- | drivers/pci/host/pcie-rockchip.c | 2 | ||||
-rw-r--r-- | drivers/pci/host/pcie-xilinx-nwl.c | 2 | ||||
-rw-r--r-- | drivers/pci/host/pcie-xilinx.c | 2 |
11 files changed, 11 insertions, 11 deletions
diff --git a/drivers/pci/host/pci-aardvark.c b/drivers/pci/host/pci-aardvark.c index 603c72181af2..709f0d69e35b 100644 --- a/drivers/pci/host/pci-aardvark.c +++ b/drivers/pci/host/pci-aardvark.c @@ -820,7 +820,7 @@ static int advk_pcie_parse_request_of_pci_ranges(struct advk_pcie *pcie) INIT_LIST_HEAD(&pcie->resources); - err = of_pci_get_host_bridge_resources(dev, 0, 0xff, + err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &pcie->resources, &iobase); if (err) return err; diff --git a/drivers/pci/host/pci-ftpci100.c b/drivers/pci/host/pci-ftpci100.c index 5c176f806fe5..87748eaeaaed 100644 --- a/drivers/pci/host/pci-ftpci100.c +++ b/drivers/pci/host/pci-ftpci100.c @@ -476,7 +476,7 @@ static int faraday_pci_probe(struct platform_device *pdev) if (IS_ERR(p->base)) return PTR_ERR(p->base); - ret = of_pci_get_host_bridge_resources(dev, 0, 0xff, + ret = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &res, &io_base); if (ret) return ret; diff --git a/drivers/pci/host/pci-v3-semi.c b/drivers/pci/host/pci-v3-semi.c index f3f39935ac2f..167bf6f6b378 100644 --- a/drivers/pci/host/pci-v3-semi.c +++ b/drivers/pci/host/pci-v3-semi.c @@ -791,7 +791,7 @@ static int v3_pci_probe(struct platform_device *pdev) if (IS_ERR(v3->config_base)) return PTR_ERR(v3->config_base); - ret = of_pci_get_host_bridge_resources(dev, 0, 0xff, &res, + ret = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &res, &io_base); if (ret) return ret; diff --git a/drivers/pci/host/pci-versatile.c b/drivers/pci/host/pci-versatile.c index ef33ec0a9e1b..ff2cd12b3978 100644 --- a/drivers/pci/host/pci-versatile.c +++ b/drivers/pci/host/pci-versatile.c @@ -67,7 +67,7 @@ static int versatile_pci_parse_request_of_pci_ranges(struct device *dev, resource_size_t iobase; struct resource_entry *win, *tmp; - err = of_pci_get_host_bridge_resources(dev, 0, 0xff, res, &iobase); + err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, res, &iobase); if (err) return err; diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c index 88e9a6d315b3..7b3ed6e34b6c 100644 --- a/drivers/pci/host/pci-xgene.c +++ b/drivers/pci/host/pci-xgene.c @@ -632,7 +632,7 @@ static int xgene_pcie_probe(struct platform_device *pdev) if (ret) return ret; - ret = of_pci_get_host_bridge_resources(dev, 0, 0xff, &res, + ret = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &res, &iobase); if (ret) return ret; diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c index 9567415aaad0..0694271d4036 100644 --- a/drivers/pci/host/pcie-altera.c +++ b/drivers/pci/host/pcie-altera.c @@ -490,7 +490,7 @@ static int altera_pcie_parse_request_of_pci_ranges(struct altera_pcie *pcie) struct device *dev = &pcie->pdev->dev; struct resource_entry *win; - err = of_pci_get_host_bridge_resources(dev, 0, 0xff, + err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &pcie->resources, NULL); if (err) return err; diff --git a/drivers/pci/host/pcie-iproc-platform.c b/drivers/pci/host/pcie-iproc-platform.c index cec0130326c9..99c2022813e4 100644 --- a/drivers/pci/host/pcie-iproc-platform.c +++ b/drivers/pci/host/pcie-iproc-platform.c @@ -99,7 +99,7 @@ static int iproc_pcie_pltfm_probe(struct platform_device *pdev) pcie->phy = NULL; } - ret = of_pci_get_host_bridge_resources(dev, 0, 0xff, &resources, + ret = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &resources, &iobase); if (ret) { dev_err(dev, "unable to get PCI host bridge resources\n"); diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c index 4c1787e021fd..6eb36c924983 100644 --- a/drivers/pci/host/pcie-rcar.c +++ b/drivers/pci/host/pcie-rcar.c @@ -1070,7 +1070,7 @@ static int rcar_pcie_parse_request_of_pci_ranges(struct rcar_pcie *pci) resource_size_t iobase; struct resource_entry *win, *tmp; - err = of_pci_get_host_bridge_resources(dev, 0, 0xff, + err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &pci->resources, &iobase); if (err) return err; diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c index abac972f0dc2..27b97fcddf15 100644 --- a/drivers/pci/host/pcie-rockchip.c +++ b/drivers/pci/host/pcie-rockchip.c @@ -1560,7 +1560,7 @@ static int rockchip_pcie_probe(struct platform_device *pdev) if (err < 0) goto err_deinit_port; - err = of_pci_get_host_bridge_resources(dev, 0, 0xff, + err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &res, &io_base); if (err) goto err_remove_irq_domain; diff --git a/drivers/pci/host/pcie-xilinx-nwl.c b/drivers/pci/host/pcie-xilinx-nwl.c index 6aea997cd21b..64df768c795c 100644 --- a/drivers/pci/host/pcie-xilinx-nwl.c +++ b/drivers/pci/host/pcie-xilinx-nwl.c @@ -854,7 +854,7 @@ static int nwl_pcie_probe(struct platform_device *pdev) return err; } - err = of_pci_get_host_bridge_resources(dev, 0, 0xff, &res, + err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &res, &iobase); if (err) { dev_err(dev, "Getting bridge resources failed\n"); diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c index fa5e44a480a4..88c96e5669e0 100644 --- a/drivers/pci/host/pcie-xilinx.c +++ b/drivers/pci/host/pcie-xilinx.c @@ -643,7 +643,7 @@ static int xilinx_pcie_probe(struct platform_device *pdev) return err; } - err = of_pci_get_host_bridge_resources(dev, 0, 0xff, &res, + err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &res, &iobase); if (err) { dev_err(dev, "Getting bridge resources failed\n"); |