linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] watchdog: cpwd: add of_node_put()
@ 2018-11-20 13:23 Yangtao Li
  2018-11-20 14:34 ` Guenter Roeck
  0 siblings, 1 reply; 3+ messages in thread
From: Yangtao Li @ 2018-11-20 13:23 UTC (permalink / raw)
  To: wim, linux; +Cc: linux-watchdog, linux-kernel, Yangtao Li

use of_node_put() to release the refcount.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/watchdog/cpwd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/watchdog/cpwd.c b/drivers/watchdog/cpwd.c
index aee0b25cf10d..d3a81642ada5 100644
--- a/drivers/watchdog/cpwd.c
+++ b/drivers/watchdog/cpwd.c
@@ -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:
-- 
2.17.0


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

* Re: [PATCH] watchdog: cpwd: add of_node_put()
  2018-11-20 13:23 [PATCH] watchdog: cpwd: add of_node_put() Yangtao Li
@ 2018-11-20 14:34 ` Guenter Roeck
  2018-11-20 14:44   ` Frank Lee
  0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2018-11-20 14:34 UTC (permalink / raw)
  To: Yangtao Li, wim; +Cc: linux-watchdog, linux-kernel

On 11/20/18 5:23 AM, Yangtao Li wrote:
> use of_node_put() to release the refcount.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> ---
>   drivers/watchdog/cpwd.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/watchdog/cpwd.c b/drivers/watchdog/cpwd.c
> index aee0b25cf10d..d3a81642ada5 100644
> --- a/drivers/watchdog/cpwd.c
> +++ b/drivers/watchdog/cpwd.c
> @@ -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

>   	return 0;
>   
>   out_unregister:
> 


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

* Re: [PATCH] watchdog: cpwd: add of_node_put()
  2018-11-20 14:34 ` Guenter Roeck
@ 2018-11-20 14:44   ` Frank Lee
  0 siblings, 0 replies; 3+ messages in thread
From: Frank Lee @ 2018-11-20 14:44 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: wim, linux-watchdog, linux-kernel

On Tue, Nov 20, 2018 at 10:34 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> On 11/20/18 5:23 AM, Yangtao Li wrote:
> > use of_node_put() to release the refcount.
> >
> > Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> > ---
> >   drivers/watchdog/cpwd.c | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/watchdog/cpwd.c b/drivers/watchdog/cpwd.c
> > index aee0b25cf10d..d3a81642ada5 100644
> > --- a/drivers/watchdog/cpwd.c
> > +++ b/drivers/watchdog/cpwd.c
> > @@ -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
>
> >       return 0;
> >
> >   out_unregister:
> >
>
Hi Guenter:

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

Yours,
    Yangtao

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

end of thread, other threads:[~2018-11-20 14:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-20 13:23 [PATCH] watchdog: cpwd: add of_node_put() Yangtao Li
2018-11-20 14:34 ` Guenter Roeck
2018-11-20 14:44   ` Frank Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).