public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	"linux-watchdog@vger.kernel.org" <linux-watchdog@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] watchdog: dw: use devm_watchdog_register_device()
Date: Fri, 25 Jan 2019 08:17:03 +0000	[thread overview]
Message-ID: <20190125161049.7884cda4@xhacker.debian> (raw)
In-Reply-To: <b521625b-ffff-ba49-77d7-018ad363db36@roeck-us.net>

Hi,

On Fri, 25 Jan 2019 00:04:25 -0800 Guenter Roeck wrote:

> Hi,
> 
> On 1/24/19 11:52 PM, Jisheng Zhang wrote:
> > Use devm_watchdog_register_device() to simplify the code.
> > 
> > Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
> > ---
> >   drivers/watchdog/dw_wdt.c | 3 +--
> >   1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
> > index 501aebb5b81f..c053c2de5c2f 100644
> > --- a/drivers/watchdog/dw_wdt.c
> > +++ b/drivers/watchdog/dw_wdt.c
> > @@ -303,7 +303,7 @@ static int dw_wdt_drv_probe(struct platform_device *pdev)
> >   
> >   	watchdog_set_restart_priority(wdd, 128);
> >   
> > -	ret = watchdog_register_device(wdd);
> > +	ret = devm_watchdog_register_device(wdd);
> >   	if (ret)
> >   		goto out_disable_clk;
> >   
> > @@ -318,7 +318,6 @@ static int dw_wdt_drv_remove(struct platform_device *pdev)
> >   {
> >   	struct dw_wdt *dw_wdt = platform_get_drvdata(pdev);
> >   
> > -	watchdog_unregister_device(&dw_wdt->wdd);
> >   	reset_control_assert(dw_wdt->rst);
> >   	clk_disable_unprepare(dw_wdt->clk);
> >   
> >   
> Unfortunately it isn't that easy. The other two calls have to be executed after
> unregistering the watchdog, meaning you would have to add devm_add_action()
> in the probe function to call them.

do you mean reset_control_asser() and the clk_disable_unprepare()? If yes,
does unregister the watchdog could trigger any register access? Per my
understanding, there's no register access path in the unregister. Am I
missing somthing?

Thanks

  reply	other threads:[~2019-01-25  8:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-25  7:52 [PATCH] watchdog: dw: use devm_watchdog_register_device() Jisheng Zhang
2019-01-25  8:04 ` Guenter Roeck
2019-01-25  8:17   ` Jisheng Zhang [this message]
2019-01-25  9:01     ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190125161049.7884cda4@xhacker.debian \
    --to=jisheng.zhang@synaptics.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=wim@linux-watchdog.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox