Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 2cbc5cd0b55fa2 ("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>

authored by

Biju Das and committed by
Wim Van Sebroeck
95abafe7 ea2949df

+2 -14
+2 -14
drivers/watchdog/rzg2l_wdt.c
··· 151 151 .restart = rzg2l_wdt_restart, 152 152 }; 153 153 154 - static void rzg2l_wdt_reset_assert_pm_disable_put(void *data) 154 + static void rzg2l_wdt_reset_assert_pm_disable(void *data) 155 155 { 156 156 struct watchdog_device *wdev = data; 157 157 struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev); 158 158 159 - pm_runtime_put(wdev->parent); 160 159 pm_runtime_disable(wdev->parent); 161 160 reset_control_assert(priv->rstc); 162 161 } ··· 205 206 206 207 reset_control_deassert(priv->rstc); 207 208 pm_runtime_enable(&pdev->dev); 208 - ret = pm_runtime_resume_and_get(&pdev->dev); 209 - if (ret < 0) { 210 - dev_err(dev, "pm_runtime_resume_and_get failed ret=%pe", ERR_PTR(ret)); 211 - goto out_pm_get; 212 - } 213 209 214 210 priv->wdev.info = &rzg2l_wdt_ident; 215 211 priv->wdev.ops = &rzg2l_wdt_ops; ··· 216 222 217 223 watchdog_set_drvdata(&priv->wdev, priv); 218 224 ret = devm_add_action_or_reset(&pdev->dev, 219 - rzg2l_wdt_reset_assert_pm_disable_put, 225 + rzg2l_wdt_reset_assert_pm_disable, 220 226 &priv->wdev); 221 227 if (ret < 0) 222 228 return ret; ··· 229 235 dev_warn(dev, "Specified timeout invalid, using default"); 230 236 231 237 return devm_watchdog_register_device(&pdev->dev, &priv->wdev); 232 - 233 - out_pm_get: 234 - pm_runtime_disable(dev); 235 - reset_control_assert(priv->rstc); 236 - 237 - return ret; 238 238 } 239 239 240 240 static const struct of_device_id rzg2l_wdt_ids[] = {