watchdog: rzg2l_wdt: Fix Runtime PM usage
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: 2cbc5cd0b5
("watchdog: Add Watchdog Timer driver for RZ/G2L")
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20220225175320.11041-3-biju.das.jz@bp.renesas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
This commit is contained in:
parent
ea2949df22
commit
95abafe762
|
@ -151,12 +151,11 @@ static const struct watchdog_ops rzg2l_wdt_ops = {
|
|||
.restart = rzg2l_wdt_restart,
|
||||
};
|
||||
|
||||
static void rzg2l_wdt_reset_assert_pm_disable_put(void *data)
|
||||
static void rzg2l_wdt_reset_assert_pm_disable(void *data)
|
||||
{
|
||||
struct watchdog_device *wdev = data;
|
||||
struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev);
|
||||
|
||||
pm_runtime_put(wdev->parent);
|
||||
pm_runtime_disable(wdev->parent);
|
||||
reset_control_assert(priv->rstc);
|
||||
}
|
||||
|
@ -206,11 +205,6 @@ static int rzg2l_wdt_probe(struct platform_device *pdev)
|
|||
|
||||
reset_control_deassert(priv->rstc);
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
ret = pm_runtime_resume_and_get(&pdev->dev);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "pm_runtime_resume_and_get failed ret=%pe", ERR_PTR(ret));
|
||||
goto out_pm_get;
|
||||
}
|
||||
|
||||
priv->wdev.info = &rzg2l_wdt_ident;
|
||||
priv->wdev.ops = &rzg2l_wdt_ops;
|
||||
|
@ -222,7 +216,7 @@ static int rzg2l_wdt_probe(struct platform_device *pdev)
|
|||
|
||||
watchdog_set_drvdata(&priv->wdev, priv);
|
||||
ret = devm_add_action_or_reset(&pdev->dev,
|
||||
rzg2l_wdt_reset_assert_pm_disable_put,
|
||||
rzg2l_wdt_reset_assert_pm_disable,
|
||||
&priv->wdev);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
@ -235,12 +229,6 @@ static int rzg2l_wdt_probe(struct platform_device *pdev)
|
|||
dev_warn(dev, "Specified timeout invalid, using default");
|
||||
|
||||
return devm_watchdog_register_device(&pdev->dev, &priv->wdev);
|
||||
|
||||
out_pm_get:
|
||||
pm_runtime_disable(dev);
|
||||
reset_control_assert(priv->rstc);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct of_device_id rzg2l_wdt_ids[] = {
|
||||
|
|
Loading…
Reference in New Issue