Linux-RISC-V Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] RISC-V: add of_node_put()
@ 2018-11-20 14:11 tiny.windzz
  2018-11-20 14:11 ` Yangtao Li
  2018-11-20 17:29 ` palmer
  0 siblings, 2 replies; 4+ messages in thread
From: tiny.windzz @ 2018-11-20 14:11 UTC (permalink / raw)
  To: linux-riscv

use of_node_put() to release the refcount.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 arch/riscv/kernel/time.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c
index 1911c8f6b8a6..40470e669a35 100644
--- a/arch/riscv/kernel/time.c
+++ b/arch/riscv/kernel/time.c
@@ -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;
-- 
2.17.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] RISC-V: add of_node_put()
  2018-11-20 14:11 [PATCH] RISC-V: add of_node_put() tiny.windzz
@ 2018-11-20 14:11 ` Yangtao Li
  2018-11-20 17:29 ` palmer
  1 sibling, 0 replies; 4+ messages in thread
From: Yangtao Li @ 2018-11-20 14:11 UTC (permalink / raw)
  To: palmer, aou, dmitriy, atish.patra, tglx
  Cc: Yangtao Li, linux-riscv, linux-kernel

use of_node_put() to release the refcount.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 arch/riscv/kernel/time.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c
index 1911c8f6b8a6..40470e669a35 100644
--- a/arch/riscv/kernel/time.c
+++ b/arch/riscv/kernel/time.c
@@ -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;
-- 
2.17.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] RISC-V: add of_node_put()
  2018-11-20 14:11 [PATCH] RISC-V: add of_node_put() tiny.windzz
  2018-11-20 14:11 ` Yangtao Li
@ 2018-11-20 17:29 ` palmer
  2018-11-20 17:29   ` Palmer Dabbelt
  1 sibling, 1 reply; 4+ messages in thread
From: palmer @ 2018-11-20 17:29 UTC (permalink / raw)
  To: linux-riscv

On Tue, 20 Nov 2018 06:11:02 PST (-0800), tiny.windzz at gmail.com wrote:
> use of_node_put() to release the refcount.
>
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> ---
>  arch/riscv/kernel/time.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c
> index 1911c8f6b8a6..40470e669a35 100644
> --- a/arch/riscv/kernel/time.c
> +++ b/arch/riscv/kernel/time.c
> @@ -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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] RISC-V: add of_node_put()
  2018-11-20 17:29 ` palmer
@ 2018-11-20 17:29   ` Palmer Dabbelt
  0 siblings, 0 replies; 4+ messages in thread
From: Palmer Dabbelt @ 2018-11-20 17:29 UTC (permalink / raw)
  To: tiny.windzz
  Cc: aou, dmitriy, tiny.windzz, linux-kernel, atish.patra, tglx, linux-riscv

On Tue, 20 Nov 2018 06:11:02 PST (-0800), tiny.windzz@gmail.com wrote:
> use of_node_put() to release the refcount.
>
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> ---
>  arch/riscv/kernel/time.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c
> index 1911c8f6b8a6..40470e669a35 100644
> --- a/arch/riscv/kernel/time.c
> +++ b/arch/riscv/kernel/time.c
> @@ -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.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-20 14:11 [PATCH] RISC-V: add of_node_put() tiny.windzz
2018-11-20 14:11 ` Yangtao Li
2018-11-20 17:29 ` palmer
2018-11-20 17:29   ` Palmer Dabbelt

Linux-RISC-V Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-riscv/0 linux-riscv/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-riscv linux-riscv/ https://lore.kernel.org/linux-riscv \
		linux-riscv@lists.infradead.org infradead-linux-riscv@archiver.kernel.org
	public-inbox-index linux-riscv


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-riscv


AGPL code for this site: git clone https://public-inbox.org/ public-inbox