Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] watchdog: Fix runtime PM imbalance on error
@ 2020-05-21  8:01 Dinghao Liu
  2020-05-21 12:57 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Dinghao Liu @ 2020-05-21  8:01 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Wim Van Sebroeck, Guenter Roeck, linux-watchdog, linux-kernel

When watchdog_register_device() returns an error code,
a pairing runtime PM usage counter decrement is needed
to keep the counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/watchdog/omap_wdt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
index 9b91882fe3c4..1616f93dfad7 100644
--- a/drivers/watchdog/omap_wdt.c
+++ b/drivers/watchdog/omap_wdt.c
@@ -273,6 +273,7 @@ static int omap_wdt_probe(struct platform_device *pdev)
 
 	ret = watchdog_register_device(&wdev->wdog);
 	if (ret) {
+		pm_runtime_put(wdev->dev);
 		pm_runtime_disable(wdev->dev);
 		return ret;
 	}
-- 
2.17.1


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

* Re: [PATCH] watchdog: Fix runtime PM imbalance on error
  2020-05-21  8:01 [PATCH] watchdog: Fix runtime PM imbalance on error Dinghao Liu
@ 2020-05-21 12:57 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2020-05-21 12:57 UTC (permalink / raw)
  To: Dinghao Liu, kjlu; +Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel

On 5/21/20 1:01 AM, Dinghao Liu wrote:
> When watchdog_register_device() returns an error code,
> a pairing runtime PM usage counter decrement is needed
> to keep the counter balanced.
> 
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>

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

> ---
>  drivers/watchdog/omap_wdt.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
> index 9b91882fe3c4..1616f93dfad7 100644
> --- a/drivers/watchdog/omap_wdt.c
> +++ b/drivers/watchdog/omap_wdt.c
> @@ -273,6 +273,7 @@ static int omap_wdt_probe(struct platform_device *pdev)
>  
>  	ret = watchdog_register_device(&wdev->wdog);
>  	if (ret) {
> +		pm_runtime_put(wdev->dev);
>  		pm_runtime_disable(wdev->dev);
>  		return ret;
>  	}
> 


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-21  8:01 [PATCH] watchdog: Fix runtime PM imbalance on error Dinghao Liu
2020-05-21 12:57 ` Guenter Roeck

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org
	public-inbox-index linux-watchdog

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git