summaryrefslogtreecommitdiff
path: root/drivers/soc
diff options
context:
space:
mode:
authorJon Hunter <jonathanh@nvidia.com>2016-06-28 13:38:27 +0300
committerThierry Reding <treding@nvidia.com>2016-06-30 13:23:08 +0300
commitb69a625826ecc563414aea5846e31b05184292f4 (patch)
tree7b034a2c342f534203814681400a113b757221d8 /drivers/soc
parent61fd284be8be06db1339ca4c9217f5a13b50074f (diff)
downloadlinux-b69a625826ecc563414aea5846e31b05184292f4.tar.xz
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: Jon Hunter <jonathanh@nvidia.com> [treding@nvidia.com: squash in a couple more of_node_put() calls] Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/tegra/pmc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index 483d54623ec5..48e1de2f7aeb 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -1540,6 +1540,7 @@ static int __init tegra_pmc_early_init(void)
*/
if (of_address_to_resource(np, 0, &regs) < 0) {
pr_err("failed to get PMC registers\n");
+ of_node_put(np);
return -ENXIO;
}
}
@@ -1547,6 +1548,7 @@ static int __init tegra_pmc_early_init(void)
pmc->base = ioremap_nocache(regs.start, resource_size(&regs));
if (!pmc->base) {
pr_err("failed to map PMC registers\n");
+ of_node_put(np);
return -ENXIO;
}
@@ -1572,6 +1574,8 @@ static int __init tegra_pmc_early_init(void)
value &= ~PMC_CNTRL_INTR_POLARITY;
tegra_pmc_writel(value, PMC_CNTRL);
+
+ of_node_put(np);
}
return 0;