Commit 471e45a3 authored by Claudiu Beznea's avatar Claudiu Beznea Committed by Wim Van Sebroeck
Browse files

watchdog: rzg2l_wdt: Check return status of pm_runtime_put()



pm_runtime_put() may return an error code. Check its return status.

Along with it the rzg2l_wdt_set_timeout() function was updated to
propagate the result of rzg2l_wdt_stop() to its caller.

Fixes: 2cbc5cd0 ("watchdog: Add Watchdog Timer driver for RZ/G2L")
Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240531065723.1085423-5-claudiu.beznea.uj@bp.renesas.com


Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent f0ba0fcd
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -144,9 +144,13 @@ static int rzg2l_wdt_start(struct watchdog_device *wdev)
static int rzg2l_wdt_stop(struct watchdog_device *wdev)
{
	struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev);
	int ret;

	rzg2l_wdt_reset(priv);
	pm_runtime_put(wdev->parent);

	ret = pm_runtime_put(wdev->parent);
	if (ret < 0)
		return ret;

	return 0;
}
@@ -163,7 +167,10 @@ static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev, unsigned int time
	 * to reset the module) so that it is updated with new timeout values.
	 */
	if (watchdog_active(wdev)) {
		rzg2l_wdt_stop(wdev);
		ret = rzg2l_wdt_stop(wdev);
		if (ret)
			return ret;

		ret = rzg2l_wdt_start(wdev);
	}