watchdog: cpwd: add of_node_put()
PATCH 1/1 watchdog: cpwd: add of_node_put()
use of_node_put() to release the refcount.
Signed-off-by Yangtao Li <[email protected]>
--- drivers/watchdog/cpwd.c | 1 + 1 file changed, 1 insertion(+)
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);return 0 ; out_unregister:
Signature · 1 line
2.17.0
Guenter Roeck
maintainerQuoted 12 lines · Yangtao Li
use
of_node_put()to release the refcount.Signed-off-by Yangtao Li <[email protected]>--- drivers/watchdog/cpwd.c | 1 + 1 file changed, 1 insertion(+)drivers/watchdog/cpwd.c +0
-0
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
-0return 0 ; out_unregister:
Quoted 15 lines · Guenter Roeck
Quoted 13 lines · Yangtao Li
use
of_node_put()to release the refcount.Signed-off-by Yangtao Li <[email protected]>--- drivers/watchdog/cpwd.c | 1 + 1 file changed, 1 insertion(+)drivers/watchdog/cpwd.c +0
-0@@ -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
-0platform_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
-0return 0 ; out_unregister:
Hi Guenter:
Yes, you're right. I will send the second version right away.
Yours,
Yangtao