Skip to contentSkip to conversation

watchdog: cpwd: add of_node_put()

PATCH Superseded Yangtao Li 2 participants 3 messages Nov 20, 2018 Watchdog device drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 watchdog: cpwd: add of_node_put()

use of_node_put() to release the refcount.

---
 drivers/watchdog/cpwd.c | 1 +
 1 file changed, 1 insertion(+)
drivers/watchdog/cpwd.c +1 -0
index aee0b25cf10d..d3a81642ada5 100644
@@ -617,6 +617,7 @@ static int cpwd_probe(struct platform_device *op)
 
 	platform_set_drvdata(op, p);
 	cpwd_device = p;
+	of_node_put(options);
 	return 0;
 
 out_unregister:
Signature · 1 line
2.17.0
maintainer
#1 lore raw
Quoted 12 lines · Yangtao Li

use of_node_put() to release the refcount.

---
  drivers/watchdog/cpwd.c | 1 +
  1 file changed, 1 insertion(+)
drivers/watchdog/cpwd.c +0 -0
index aee0b25cf10d..d3a81642ada5 100644

drivers/watchdog/cpwd.c static int cpwd_probe(struct platform_device *op) · line 620

Quoted 4 lines
drivers/watchdog/cpwd.c +1 -0
@@ -617,6 +617,7 @@ static int cpwd_probe(struct platform_device *op)
 
  	platform_set_drvdata(op, p);
  	cpwd_device = p;
+	of_node_put(options);

It would be better to do that right after its last use to also cover error handling.

Guenter

Quoted 4 lines
drivers/watchdog/cpwd.c +0 -0
  	return 0;
 
  out_unregister:
author
#2 lore raw
Quoted 15 lines · Guenter Roeck
Quoted 13 lines · Yangtao Li

use of_node_put() to release the refcount.

---
  drivers/watchdog/cpwd.c | 1 +
  1 file changed, 1 insertion(+)
drivers/watchdog/cpwd.c +0 -0
index aee0b25cf10d..d3a81642ada5 100644
@@ -617,6 +617,7 @@ static int cpwd_probe(struct platform_device *op)
 
Quoted 14 lines

drivers/watchdog/cpwd.c static int cpwd_probe(struct platform_device *op) · line 620

Quoted 3 lines
drivers/watchdog/cpwd.c +1 -0
      platform_set_drvdata(op, p);
      cpwd_device = p;
+     of_node_put(options);

It would be better to do that right after its last use to also cover error handling.

Guenter

Quoted 4 lines
drivers/watchdog/cpwd.c +0 -0
      return 0;
 
  out_unregister:

Hi Guenter:

Yes, you're right. I will send the second version right away.

Yours,
Yangtao