Skip to content

Commit a0b6005

Browse files
bijudasSasha Levin
authored andcommitted
watchdog: rzg2l_wdt: Fix Runtime PM usage
[ Upstream commit 95abafe ] Both rzg2l_wdt_probe() and rzg2l_wdt_start() calls pm_runtime_get() which results in a usage counter imbalance. This patch fixes this issue by removing pm_runtime_get() call from probe. Fixes: 2cbc5cd ("watchdog: Add Watchdog Timer driver for RZ/G2L") Signed-off-by: Biju Das <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 67deb1b commit a0b6005

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

drivers/watchdog/rzg2l_wdt.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,11 @@ static const struct watchdog_ops rzg2l_wdt_ops = {
151151
.restart = rzg2l_wdt_restart,
152152
};
153153

154-
static void rzg2l_wdt_reset_assert_pm_disable_put(void *data)
154+
static void rzg2l_wdt_reset_assert_pm_disable(void *data)
155155
{
156156
struct watchdog_device *wdev = data;
157157
struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev);
158158

159-
pm_runtime_put(wdev->parent);
160159
pm_runtime_disable(wdev->parent);
161160
reset_control_assert(priv->rstc);
162161
}
@@ -206,11 +205,6 @@ static int rzg2l_wdt_probe(struct platform_device *pdev)
206205

207206
reset_control_deassert(priv->rstc);
208207
pm_runtime_enable(&pdev->dev);
209-
ret = pm_runtime_resume_and_get(&pdev->dev);
210-
if (ret < 0) {
211-
dev_err(dev, "pm_runtime_resume_and_get failed ret=%pe", ERR_PTR(ret));
212-
goto out_pm_get;
213-
}
214208

215209
priv->wdev.info = &rzg2l_wdt_ident;
216210
priv->wdev.ops = &rzg2l_wdt_ops;
@@ -222,7 +216,7 @@ static int rzg2l_wdt_probe(struct platform_device *pdev)
222216

223217
watchdog_set_drvdata(&priv->wdev, priv);
224218
ret = devm_add_action_or_reset(&pdev->dev,
225-
rzg2l_wdt_reset_assert_pm_disable_put,
219+
rzg2l_wdt_reset_assert_pm_disable,
226220
&priv->wdev);
227221
if (ret < 0)
228222
return ret;
@@ -235,12 +229,6 @@ static int rzg2l_wdt_probe(struct platform_device *pdev)
235229
dev_warn(dev, "Specified timeout invalid, using default");
236230

237231
return devm_watchdog_register_device(&pdev->dev, &priv->wdev);
238-
239-
out_pm_get:
240-
pm_runtime_disable(dev);
241-
reset_control_assert(priv->rstc);
242-
243-
return ret;
244232
}
245233

246234
static const struct of_device_id rzg2l_wdt_ids[] = {

0 commit comments

Comments
 (0)