提交 b69a6258 编写于 作者: J Jon Hunter 提交者: Thierry Reding

soc/tegra: pmc: Add missing of_node_put()

Add missing of_node_put() in PMC early initialisation function to avoid
leaking the device nodes.
Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
[treding@nvidia.com: squash in a couple more of_node_put() calls]
Signed-off-by: NThierry Reding <treding@nvidia.com>
上级 61fd284b
...@@ -1540,6 +1540,7 @@ static int __init tegra_pmc_early_init(void) ...@@ -1540,6 +1540,7 @@ static int __init tegra_pmc_early_init(void)
*/ */
if (of_address_to_resource(np, 0, &regs) < 0) { if (of_address_to_resource(np, 0, &regs) < 0) {
pr_err("failed to get PMC registers\n"); pr_err("failed to get PMC registers\n");
of_node_put(np);
return -ENXIO; return -ENXIO;
} }
} }
...@@ -1547,6 +1548,7 @@ static int __init tegra_pmc_early_init(void) ...@@ -1547,6 +1548,7 @@ static int __init tegra_pmc_early_init(void)
pmc->base = ioremap_nocache(regs.start, resource_size(&regs)); pmc->base = ioremap_nocache(regs.start, resource_size(&regs));
if (!pmc->base) { if (!pmc->base) {
pr_err("failed to map PMC registers\n"); pr_err("failed to map PMC registers\n");
of_node_put(np);
return -ENXIO; return -ENXIO;
} }
...@@ -1572,6 +1574,8 @@ static int __init tegra_pmc_early_init(void) ...@@ -1572,6 +1574,8 @@ static int __init tegra_pmc_early_init(void)
value &= ~PMC_CNTRL_INTR_POLARITY; value &= ~PMC_CNTRL_INTR_POLARITY;
tegra_pmc_writel(value, PMC_CNTRL); tegra_pmc_writel(value, PMC_CNTRL);
of_node_put(np);
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册