Skip to contentSkip to conversation

clk: tegra: Add missing of_node_put()

PATCH Applied Liang He 2 participants 2 messages Jun 17, 2022 – Aug 19, 2022

Subsystems (3)
lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH v4 1/1 clk: tegra: Add missing of_node_put()

In tegra124_132_clock_init_pre() and tegra30_clock_init(), of_find_matching_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore.

---
changelog:

v4: split v3 into nomadik and tegra
v3: merge clk 'missing of_node_put()' patches into one commit.
v2: use Liang He as real name for S-o-b.
v1: fix the missing of_node_put().

 drivers/clk/tegra/clk-tegra124.c | 1 +
 drivers/clk/tegra/clk-tegra30.c  | 1 +
 2 files changed, 2 insertions(+)
drivers/clk/tegra/clk-tegra124.c +1 -0
index 934520aab6e3..a9d4efcef2d4 100644
@@ -1471,6 +1471,7 @@ static void __init tegra124_132_clock_init_pre(struct device_node *np)
 	}
 
 	pmc_base = of_iomap(node, 0);
+	of_node_put(node);
 	if (!pmc_base) {
 		pr_err("Can't map pmc registers\n");
 		WARN_ON(1);
drivers/clk/tegra/clk-tegra30.c +1 -0
index 04b496123820..168c07d5a5f2 100644
@@ -1320,6 +1320,7 @@ static void __init tegra30_clock_init(struct device_node *np)
 	}
 
 	pmc_base = of_iomap(node, 0);
+	of_node_put(node);
 	if (!pmc_base) {
 		pr_err("Can't map pmc registers\n");
 		BUG();
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw

Quoting Liang He (2022-06-16 18:59:18)

Quoted 7 lines

In tegra124_132_clock_init_pre() and tegra30_clock_init(), of_find_matching_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore.

---

Applied to clk-next