linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] watchdog: ar7_wdt: Make use of the helper function devm_platform_ioremap_resource_byname()
@ 2021-09-07  7:42 Cai Huoqing
  2021-09-07 12:38 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Cai Huoqing @ 2021-09-07  7:42 UTC (permalink / raw)
  To: caihuoqing; +Cc: Wim Van Sebroeck, Guenter Roeck, linux-watchdog, linux-kernel

Use the devm_platform_ioremap_resource_byname() helper instead of
calling platform_get_resource_byname() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
 drivers/watchdog/ar7_wdt.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/watchdog/ar7_wdt.c b/drivers/watchdog/ar7_wdt.c
index ff37dc91057d..743e171d97a3 100644
--- a/drivers/watchdog/ar7_wdt.c
+++ b/drivers/watchdog/ar7_wdt.c
@@ -63,8 +63,6 @@ static DEFINE_SPINLOCK(wdt_lock);
 /* XXX currently fixed, allows max margin ~68.72 secs */
 #define prescale_value 0xffff
 
-/* Resource of the WDT registers */
-static struct resource *ar7_regs_wdt;
 /* Pointer to the remapped WDT IO space */
 static struct ar7_wdt *ar7_wdt;
 
@@ -265,9 +263,7 @@ static int ar7_wdt_probe(struct platform_device *pdev)
 {
 	int rc;
 
-	ar7_regs_wdt =
-		platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
-	ar7_wdt = devm_ioremap_resource(&pdev->dev, ar7_regs_wdt);
+	ar7_wdt = devm_platform_ioremap_resource_byname(pdev, "regs");
 	if (IS_ERR(ar7_wdt))
 		return PTR_ERR(ar7_wdt);
 
-- 
2.25.1


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

* Re: [PATCH] watchdog: ar7_wdt: Make use of the helper function devm_platform_ioremap_resource_byname()
  2021-09-07  7:42 [PATCH] watchdog: ar7_wdt: Make use of the helper function devm_platform_ioremap_resource_byname() Cai Huoqing
@ 2021-09-07 12:38 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2021-09-07 12:38 UTC (permalink / raw)
  To: Cai Huoqing; +Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel

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

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

> ---
>  drivers/watchdog/ar7_wdt.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/watchdog/ar7_wdt.c b/drivers/watchdog/ar7_wdt.c
> index ff37dc91057d..743e171d97a3 100644
> --- a/drivers/watchdog/ar7_wdt.c
> +++ b/drivers/watchdog/ar7_wdt.c
> @@ -63,8 +63,6 @@ static DEFINE_SPINLOCK(wdt_lock);
>  /* XXX currently fixed, allows max margin ~68.72 secs */
>  #define prescale_value 0xffff
>  
> -/* Resource of the WDT registers */
> -static struct resource *ar7_regs_wdt;
>  /* Pointer to the remapped WDT IO space */
>  static struct ar7_wdt *ar7_wdt;
>  
> @@ -265,9 +263,7 @@ static int ar7_wdt_probe(struct platform_device *pdev)
>  {
>  	int rc;
>  
> -	ar7_regs_wdt =
> -		platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
> -	ar7_wdt = devm_ioremap_resource(&pdev->dev, ar7_regs_wdt);
> +	ar7_wdt = devm_platform_ioremap_resource_byname(pdev, "regs");
>  	if (IS_ERR(ar7_wdt))
>  		return PTR_ERR(ar7_wdt);
>  
> -- 
> 2.25.1
> 

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

end of thread, other threads:[~2021-09-07 12:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07  7:42 [PATCH] watchdog: ar7_wdt: Make use of the helper function devm_platform_ioremap_resource_byname() Cai Huoqing
2021-09-07 12:38 ` Guenter Roeck

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).