From 10e23539dcaa73fe53a20f7529d6afe0e23f6357 Mon Sep 17 00:00:00 2001 From: Bharat Kumar Gogada Date: Mon, 20 May 2019 12:24:13 +0530 Subject: [PATCH] PCI XDMA PL: Remove of_pci_get_host_bridge_resources of_pci_get_host_bridge_resources() allocates the resource structures it fills dynamically but these resources are not released. So convert the existing function to a managed version, devm_of_pci_get_host_bridge_resources(). Signed-off-by: Bharat Kumar Gogada --- drivers/pci/controller/pcie-xdma-pl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/pcie-xdma-pl.c b/drivers/pci/controller/pcie-xdma-pl.c index c9f9784..8ef3c3a 100644 --- a/drivers/pci/controller/pcie-xdma-pl.c +++ b/drivers/pci/controller/pcie-xdma-pl.c @@ -22,6 +22,8 @@ #include #include +#include "../pci.h" + /* Register definitions */ #define XILINX_PCIE_REG_VSEC 0x0000012c #define XILINX_PCIE_REG_BIR 0x00000130 @@ -757,8 +759,8 @@ static int xilinx_pcie_probe(struct platform_device *pdev) return err; } - err = of_pci_get_host_bridge_resources(dev->of_node, 0, 0xff, &res, - &iobase); + err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &res, + &iobase); if (err) { dev_err(dev, "Getting bridge resources failed\n"); return err; -- 2.7.4