* [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 related [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, other threads:[~2020-05-21 12:57 UTC | newest]
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
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).