mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] watchdog: starfive: Fix the probe return error if PM and early_enable are both disabled
@ 2023-04-26  3:12 Xingyu Wu
  2023-04-26  3:53 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Xingyu Wu @ 2023-04-26  3:12 UTC (permalink / raw)
  To: linux-watchdog, Wim Van Sebroeck, Guenter Roeck
  Cc: Xingyu Wu, Samin Guo, linux-kernel

When the starfive watchdog driver uses 'pm_runtime_put_sync()' as probe
return value at last and 'early_enable' is disabled, it could return the
error '-ENOSYS' if the CONFIG_PM is disabled, but the driver should works
normally.

Drop the 'return' and keep the 'pm_runtime_put_sync()', but do not use it
as the return value.

Fixes: db728ea9c7be ("drivers: watchdog: Add StarFive Watchdog driver")
Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>
---

Hi, Guenter and Wim,

This patch fixes the issue of StarFive watchdog driver and rebases on
the master branch of linux-next.

Thanks.

Changes since v1:
- Dropped the check of PM and used the 'pm_runtime_put_sync()' directly.

v1: https://lore.kernel.org/all/20230425100456.32718-1-xingyu.wu@starfivetech.com/
 
---
 drivers/watchdog/starfive-wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/starfive-wdt.c b/drivers/watchdog/starfive-wdt.c
index 1995cceca51e..8f378900624d 100644
--- a/drivers/watchdog/starfive-wdt.c
+++ b/drivers/watchdog/starfive-wdt.c
@@ -492,7 +492,7 @@ static int starfive_wdt_probe(struct platform_device *pdev)
 		goto err_exit;
 
 	if (!early_enable)
-		return pm_runtime_put_sync(&pdev->dev);
+		pm_runtime_put_sync(&pdev->dev);
 
 	return 0;
 
-- 
2.25.1


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

* Re: [PATCH v2] watchdog: starfive: Fix the probe return error if PM and early_enable are both disabled
  2023-04-26  3:12 [PATCH v2] watchdog: starfive: Fix the probe return error if PM and early_enable are both disabled Xingyu Wu
@ 2023-04-26  3:53 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2023-04-26  3:53 UTC (permalink / raw)
  To: Xingyu Wu; +Cc: linux-watchdog, Wim Van Sebroeck, Samin Guo, linux-kernel

On Wed, Apr 26, 2023 at 11:12:16AM +0800, Xingyu Wu wrote:
> When the starfive watchdog driver uses 'pm_runtime_put_sync()' as probe
> return value at last and 'early_enable' is disabled, it could return the
> error '-ENOSYS' if the CONFIG_PM is disabled, but the driver should works
> normally.
> 
> Drop the 'return' and keep the 'pm_runtime_put_sync()', but do not use it
> as the return value.
> 
> Fixes: db728ea9c7be ("drivers: watchdog: Add StarFive Watchdog driver")
> Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>

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

> ---
> 
> Hi, Guenter and Wim,
> 
> This patch fixes the issue of StarFive watchdog driver and rebases on
> the master branch of linux-next.
> 
> Thanks.
> 
> Changes since v1:
> - Dropped the check of PM and used the 'pm_runtime_put_sync()' directly.
> 
> v1: https://lore.kernel.org/all/20230425100456.32718-1-xingyu.wu@starfivetech.com/
>  
> ---
>  drivers/watchdog/starfive-wdt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/starfive-wdt.c b/drivers/watchdog/starfive-wdt.c
> index 1995cceca51e..8f378900624d 100644
> --- a/drivers/watchdog/starfive-wdt.c
> +++ b/drivers/watchdog/starfive-wdt.c
> @@ -492,7 +492,7 @@ static int starfive_wdt_probe(struct platform_device *pdev)
>  		goto err_exit;
>  
>  	if (!early_enable)
> -		return pm_runtime_put_sync(&pdev->dev);
> +		pm_runtime_put_sync(&pdev->dev);
>  
>  	return 0;
>  
> -- 
> 2.25.1
> 

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

end of thread, other threads:[~2023-04-26  3:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-26  3:12 [PATCH v2] watchdog: starfive: Fix the probe return error if PM and early_enable are both disabled Xingyu Wu
2023-04-26  3:53 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®