Skip to contentSkip to conversation

clocksource/drivers/integrator-ap: add of_node_put()

PATCH Applied Yangtao Li 3 participants 14 messages Nov 20, 2018 – Nov 22, 2018 Clocksource, clockevent drivers

lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 clocksource/drivers/integrator-ap: add of_node_put()

use of_node_put() to release the refcount.

---
 drivers/clocksource/timer-integrator-ap.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/clocksource/timer-integrator-ap.c +7 -5
index 76e526f58620..50e0a9166f66 100644
@@ -204,8 +204,6 @@ static int __init integrator_ap_timer_init_of(struct device_node *node)
 		return err;
 	}
 
-	pri_node = of_find_node_by_path(path);
-
 	err = of_property_read_string(of_aliases,
 				"arm,timer-secondary", &path);
 	if (err) {
@@ -213,14 +211,18 @@ static int __init integrator_ap_timer_init_of(struct device_node *node)
 		return err;
 	}
 
+	pri_node = of_find_node_by_path(path);
+	if (node == pri_node){
+		of_node_put(pri_node);
 
-	sec_node = of_find_node_by_path(path);
-
-	if (node == pri_node)
 		/* The primary timer lacks IRQ, use as clocksource */
 		return integrator_clocksource_init(rate, base);
+	}
 
+	sec_node = of_find_node_by_path(path);
 	if (node == sec_node) {
+		of_node_put(sec_node);
+
 		/* The secondary timer will drive the clock event */
 		irq = irq_of_parse_and_map(node, 0);
 		return integrator_clockevent_init(rate, base, irq);
Signature · 1 line
2.17.0
#1 lore raw

Hi Yangtao,

Quoted 1 line · Yangtao Li

use of_node_put() to release the refcount.

In future please give a better description.

No need to resend, I'll do the change.

Linus? I'm about to take this patch. Is it fine for you?

Quoted 41 lines
---
 drivers/clocksource/timer-integrator-ap.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/clocksource/timer-integrator-ap.c +7 -5
index 76e526f58620..50e0a9166f66 100644
@@ -204,8 +204,6 @@ static int __init integrator_ap_timer_init_of(struct device_node *node)
 		return err;
 	}
 
-	pri_node = of_find_node_by_path(path);
-
 	err = of_property_read_string(of_aliases,
 				"arm,timer-secondary", &path);
 	if (err) {
@@ -213,14 +211,18 @@ static int __init integrator_ap_timer_init_of(struct device_node *node)
 		return err;
 	}
 
+	pri_node = of_find_node_by_path(path);
+	if (node == pri_node){
+		of_node_put(pri_node);
 
-	sec_node = of_find_node_by_path(path);
-
-	if (node == pri_node)
 		/* The primary timer lacks IRQ, use as clocksource */
 		return integrator_clocksource_init(rate, base);
+	}
 
+	sec_node = of_find_node_by_path(path);
 	if (node == sec_node) {
+		of_node_put(sec_node);
+
 		/* The secondary timer will drive the clock event */
 		irq = irq_of_parse_and_map(node, 0);
 		return integrator_clockevent_init(rate, base, irq);
Signature · 5 lines
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#3 lore raw
Quoted 2 lines · Linus Walleij

Thanks!

Signature · 5 lines
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#4 lore raw
In reply to Yangtao Li
Quoted 3 lines · Yangtao Li

use of_node_put() to release the refcount.

Applied, thanks!

Signature · 5 lines
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
author
#5 lore raw
Quoted 7 lines · Daniel Lezcano
Quoted 3 lines · Yangtao Li

use of_node_put() to release the refcount.

Applied, thanks!

Hi Daniel:

This patch is a bit small, I will resend。

Thanks,
Yangtao

Quoted 9 lines

--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

author
#6 lore raw
Quoted 5 lines · Frank Lee
Quoted 2 lines · Daniel Lezcano

On 20/11/2018 14:18, Yangtao Li wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

use of_node_put() to release the refcount.

Applied, thanks!

Hi Daniel:

This patch is a bit small, I will resend。

Code logic seems to be a bit problem, sorry

--Yangtao

Quoted 12 lines

Thanks,
Yangtao

Quoted 9 lines

--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

#7 lore raw
In reply to Frank Lee
Quoted 4 lines · Frank Lee
Quoted 2 lines · Daniel Lezcano

On 20/11/2018 14:18, Yangtao Li wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

use of_node_put() to release the refcount.

Applied, thanks!

Hi Daniel:

This patch is a bit small, I will resend。

What do you mean by 'small' ?

Quoted 7 lines
Quoted 7 lines

--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

Signature · 5 lines
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
author
#8 lore raw
Quoted 8 lines · Daniel Lezcano
Quoted 6 lines · Frank Lee
Quoted 4 lines · Daniel Lezcano
Quoted 2 lines · Yangtao Li

use of_node_put() to release the refcount.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Applied, thanks!

Hi Daniel:

This patch is a bit small, I will resend。

What do you mean by 'small' ?

        pri_node = of_find_node_by_path(path);
        if (node == pri_node){
                of_node_put(pri_node);

                /* The primary timer lacks IRQ, use as clocksource */
                return integrator_clocksource_init(rate, base);
        }

        sec_node = of_find_node_by_path(path);

Under my revision, pri_node and sec_nodeare the same thing.

Yours,
Yangtao

Quoted 17 lines
Quoted 8 lines
Quoted 8 lines

--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

#9 lore raw
Quoted 49 lines · Frank Lee
Quoted 8 lines · Daniel Lezcano
Quoted 6 lines · Frank Lee
Quoted 4 lines · Daniel Lezcano
Quoted 2 lines · Yangtao Li

use of_node_put() to release the refcount.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Applied, thanks!

Hi Daniel:

This patch is a bit small, I will resend。

What do you mean by 'small' ?

        pri_node = of_find_node_by_path(path);
        if (node == pri_node){
                of_node_put(pri_node);

                /* The primary timer lacks IRQ, use as clocksource */
                return integrator_clocksource_init(rate, base);
        }

        sec_node = of_find_node_by_path(path);

Under my revision, pri_node and sec_nodeare the same thing.

Yours,
Yangtao

Quoted 17 lines
Quoted 8 lines
Quoted 8 lines

--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

Signature · 5 lines
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#10 lore raw

PATCH 1/1 clocksource/drivers/integrator-ap: add of_node_put()

In reply to Frank Lee
Quoted 28 lines · Frank Lee
Quoted 8 lines · Daniel Lezcano
Quoted 6 lines · Frank Lee
Quoted 4 lines · Daniel Lezcano
Quoted 2 lines · Yangtao Li

use of_node_put() to release the refcount.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Applied, thanks!

Hi Daniel:

This patch is a bit small, I will resend。

What do you mean by 'small' ?

        pri_node = of_find_node_by_path(path);
        if (node == pri_node){
                of_node_put(pri_node);

                /* The primary timer lacks IRQ, use as clocksource */
                return integrator_clocksource_init(rate, base);
        }

        sec_node = of_find_node_by_path(path);
Quoted 1 line

Under my revision, pri_node and sec_nodeare the same thing.

Oh, right. Missed it :/

Signature · 5 lines
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
author
#11 lore raw
Quoted 28 lines · Daniel Lezcano
Quoted 26 lines · Frank Lee
Quoted 8 lines · Daniel Lezcano
Quoted 6 lines · Frank Lee
Quoted 4 lines · Daniel Lezcano
Quoted 2 lines · Yangtao Li

use of_node_put() to release the refcount.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Applied, thanks!

Hi Daniel:

This patch is a bit small, I will resend。

What do you mean by 'small' ?

        pri_node = of_find_node_by_path(path);
        if (node == pri_node){
                of_node_put(pri_node);

                /* The primary timer lacks IRQ, use as clocksource */
                return integrator_clocksource_init(rate, base);
        }
Quoted 5 lines
Quoted 3 lines
        sec_node = of_find_node_by_path(path);

Under my revision, pri_node and sec_nodeare the same thing.

Oh, right. Missed it :/

Daniel ,

Have you mde the patch merged?
Which git is the patch in?
I hope that you can revert it and I‘ll resend new one or I'll resend patch based on the modify.

Yours,
Yangtao

Quoted 10 lines

--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

#12 lore raw
Quoted 34 lines · Frank Lee
Quoted 32 lines · Daniel Lezcano
Quoted 29 lines · Frank Lee
Quoted 8 lines · Daniel Lezcano
Quoted 6 lines · Frank Lee
Quoted 4 lines · Daniel Lezcano
Quoted 2 lines · Yangtao Li

use of_node_put() to release the refcount.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Applied, thanks!

Hi Daniel:

This patch is a bit small, I will resend。

What do you mean by 'small' ?

        pri_node = of_find_node_by_path(path);
        if (node == pri_node){
                of_node_put(pri_node);

                /* The primary timer lacks IRQ, use as clocksource */
                return integrator_clocksource_init(rate, base);
        }

        sec_node = of_find_node_by_path(path);

Under my revision, pri_node and sec_nodeare the same thing.

Quoted 7 lines
Quoted 1 line

Oh, right. Missed it :/

Daniel ,

Have you mde the patch merged?
Which git is the patch in?
I hope that you can revert it and I‘ll resend new one or I'll resend patch based on the modify.

I can drop it, resend a new one.

Signature · 5 lines
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
author
#13 lore raw
Quoted 37 lines · Daniel Lezcano
Quoted 35 lines · Frank Lee
Quoted 33 lines · Daniel Lezcano
Quoted 28 lines · Frank Lee
Quoted 8 lines · Daniel Lezcano
Quoted 6 lines · Frank Lee
Quoted 4 lines · Daniel Lezcano
Quoted 2 lines · Yangtao Li

use of_node_put() to release the refcount.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Applied, thanks!

Hi Daniel:

This patch is a bit small, I will resend。

What do you mean by 'small' ?

        pri_node = of_find_node_by_path(path);
        if (node == pri_node){
                of_node_put(pri_node);

                /* The primary timer lacks IRQ, use as clocksource */
                return integrator_clocksource_init(rate, base);
        }

        sec_node = of_find_node_by_path(path);
Quoted 1 line

Under my revision, pri_node and sec_nodeare the same thing.

Oh, right. Missed it :/

Quoted 8 lines
Quoted 6 lines

Daniel ,

Have you mde the patch merged?
Which git is the patch in?
I hope that you can revert it and I‘ll resend new one or I'll resend patch based on the modify.

I can drop it, resend a new one.

Thanks,
Yangtao

Quoted 9 lines

--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog