Skip to contentSkip to conversation

RISC-V: add of_node_put()

PATCH In review Yangtao Li 2 participants 2 messages Nov 20, 2018 RISC-V

lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 RISC-V: add of_node_put()

use of_node_put() to release the refcount.

---
 arch/riscv/kernel/time.c | 1 +
 1 file changed, 1 insertion(+)
arch/riscv/kernel/time.c +1 -0
index 1911c8f6b8a6..40470e669a35 100644
@@ -26,6 +26,7 @@ void __init time_init(void)
 	cpu = of_find_node_by_path("/cpus");
 	if (!cpu || of_property_read_u32(cpu, "timebase-frequency", &prop))
 		panic(KERN_WARNING "RISC-V system with no 'timebase-frequency' in DTS\n");
+	of_node_put(cpu);
 	riscv_timebase = prop;
 
 	lpj_fine = riscv_timebase / HZ;
Signature · 1 line
2.17.0
#1 lore raw
Quoted 12 lines · tiny.windzz at gmail.com

use of_node_put() to release the refcount.

---
 arch/riscv/kernel/time.c | 1 +
 1 file changed, 1 insertion(+)
arch/riscv/kernel/time.c +0 -0
index 1911c8f6b8a6..40470e669a35 100644

arch/riscv/kernel/time.c void __init time_init(void) · line 32

Quoted 7 lines
arch/riscv/kernel/time.c +1 -0
@@ -26,6 +26,7 @@ void __init time_init(void)
 	cpu = of_find_node_by_path("/cpus");
 	if (!cpu || of_property_read_u32(cpu, "timebase-frequency", &prop))
 		panic(KERN_WARNING "RISC-V system with no 'timebase-frequency' in DTS\n");
+	of_node_put(cpu);
 	riscv_timebase = prop;
 
 	lpj_fine = riscv_timebase / HZ;

Thanks. I'm going to target this for next week's PR.