mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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 <[email protected]> [[email protected]: squash in a couple more of_node_put() calls] Signed-off-by: Thierry Reding <[email protected]>
This commit is contained in:
parent
61fd284be8
commit
b69a625826
1 changed files with 4 additions and 0 deletions
|
|
@ -1540,6 +1540,7 @@ static int __init tegra_pmc_early_init(void)
|
|||
*/
|
||||
if (of_address_to_resource(np, 0, ®s) < 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(®s));
|
||||
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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue