Commit 4a4fb661 authored by Anson Huang's avatar Anson Huang Committed by Shawn Guo

ARM: imx: Add missing of_node_put()

After finishing using device node got from of_find_compatible_node(),
of_node_put() needs to be called.
Signed-off-by: default avatarAnson Huang <Anson.Huang@nxp.com>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
parent cc56f77e
...@@ -94,7 +94,7 @@ void imx_anatop_post_resume(void) ...@@ -94,7 +94,7 @@ void imx_anatop_post_resume(void)
void __init imx_init_revision_from_anatop(void) void __init imx_init_revision_from_anatop(void)
{ {
struct device_node *np; struct device_node *np, *src_np;
void __iomem *anatop_base; void __iomem *anatop_base;
unsigned int revision; unsigned int revision;
u32 digprog; u32 digprog;
...@@ -135,9 +135,10 @@ void __init imx_init_revision_from_anatop(void) ...@@ -135,9 +135,10 @@ void __init imx_init_revision_from_anatop(void)
void __iomem *src_base; void __iomem *src_base;
u32 sbmr2; u32 sbmr2;
np = of_find_compatible_node(NULL, NULL, src_np = of_find_compatible_node(NULL, NULL,
"fsl,imx6ul-src"); "fsl,imx6ul-src");
src_base = of_iomap(np, 0); src_base = of_iomap(np, 0);
of_node_put(src_np);
WARN_ON(!src_base); WARN_ON(!src_base);
sbmr2 = readl_relaxed(src_base + SRC_SBMR2); sbmr2 = readl_relaxed(src_base + SRC_SBMR2);
iounmap(src_base); iounmap(src_base);
...@@ -149,6 +150,7 @@ void __init imx_init_revision_from_anatop(void) ...@@ -149,6 +150,7 @@ void __init imx_init_revision_from_anatop(void)
} }
} }
} }
of_node_put(np);
mxc_set_cpu_type(digprog >> 16 & 0xff); mxc_set_cpu_type(digprog >> 16 & 0xff);
imx_set_soc_revision(revision); imx_set_soc_revision(revision);
......
...@@ -282,4 +282,5 @@ void __init imx_gpc_check_dt(void) ...@@ -282,4 +282,5 @@ void __init imx_gpc_check_dt(void)
/* map GPC, so that at least CPUidle and WARs keep working */ /* map GPC, so that at least CPUidle and WARs keep working */
gpc_base = of_iomap(np, 0); gpc_base = of_iomap(np, 0);
} }
of_node_put(np);
} }
...@@ -109,6 +109,7 @@ static void __init ls1021a_smp_prepare_cpus(unsigned int max_cpus) ...@@ -109,6 +109,7 @@ static void __init ls1021a_smp_prepare_cpus(unsigned int max_cpus)
np = of_find_compatible_node(NULL, NULL, "fsl,ls1021a-dcfg"); np = of_find_compatible_node(NULL, NULL, "fsl,ls1021a-dcfg");
dcfg_base = of_iomap(np, 0); dcfg_base = of_iomap(np, 0);
of_node_put(np);
BUG_ON(!dcfg_base); BUG_ON(!dcfg_base);
paddr = __pa_symbol(secondary_startup); paddr = __pa_symbol(secondary_startup);
......
...@@ -655,6 +655,8 @@ void __init imx6_pm_ccm_init(const char *ccm_compat) ...@@ -655,6 +655,8 @@ void __init imx6_pm_ccm_init(const char *ccm_compat)
if (of_property_read_bool(np, "fsl,pmic-stby-poweroff")) if (of_property_read_bool(np, "fsl,pmic-stby-poweroff"))
imx6_pm_stby_poweroff_probe(); imx6_pm_stby_poweroff_probe();
of_node_put(np);
} }
void __init imx6q_pm_init(void) void __init imx6q_pm_init(void)
......
...@@ -62,6 +62,7 @@ void __init imx7ulp_pm_init(void) ...@@ -62,6 +62,7 @@ void __init imx7ulp_pm_init(void)
np = of_find_compatible_node(NULL, NULL, "fsl,imx7ulp-smc1"); np = of_find_compatible_node(NULL, NULL, "fsl,imx7ulp-smc1");
smc1_base = of_iomap(np, 0); smc1_base = of_iomap(np, 0);
of_node_put(np);
WARN_ON(!smc1_base); WARN_ON(!smc1_base);
imx7ulp_set_lpm(ULP_PM_RUN); imx7ulp_set_lpm(ULP_PM_RUN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment