linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Cai Huoqing <caihuoqing@baidu.com>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: rti-wdt: Make use of the helper function devm_platform_ioremap_resource()
Date: Tue, 7 Sep 2021 05:40:04 -0700	[thread overview]
Message-ID: <20210907124004.GC4989@roeck-us.net> (raw)
In-Reply-To: <20210907074237.2808-1-caihuoqing@baidu.com>

On Tue, Sep 07, 2021 at 03:42:36PM +0800, Cai Huoqing wrote:
> Use the devm_platform_ioremap_resource() helper instead of
> calling platform_get_resource() and devm_ioremap_resource()
> separately
> 
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/rti_wdt.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c
> index 359302f71f7e..117bc2a8eb0a 100644
> --- a/drivers/watchdog/rti_wdt.c
> +++ b/drivers/watchdog/rti_wdt.c
> @@ -194,7 +194,6 @@ static int rti_wdt_probe(struct platform_device *pdev)
>  {
>  	int ret = 0;
>  	struct device *dev = &pdev->dev;
> -	struct resource *wdt_mem;
>  	struct watchdog_device *wdd;
>  	struct rti_wdt_device *wdt;
>  	struct clk *clk;
> @@ -246,8 +245,7 @@ static int rti_wdt_probe(struct platform_device *pdev)
>  	watchdog_set_nowayout(wdd, 1);
>  	watchdog_set_restart_priority(wdd, 128);
>  
> -	wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	wdt->base = devm_ioremap_resource(dev, wdt_mem);
> +	wdt->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(wdt->base)) {
>  		ret = PTR_ERR(wdt->base);
>  		goto err_iomap;
> -- 
> 2.25.1
> 

      reply	other threads:[~2021-09-07 12:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07  7:42 [PATCH] watchdog: rti-wdt: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
2021-09-07 12:40 ` Guenter Roeck [this message]

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=20210907124004.GC4989@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=caihuoqing@baidu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).