Skip to content

Commit 471e45a

Browse files
claudiubezneaWim Van Sebroeck
authored andcommitted
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: 2cbc5cd ("watchdog: Add Watchdog Timer driver for RZ/G2L") Signed-off-by: Claudiu Beznea <[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]>
1 parent f0ba0fc commit 471e45a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/watchdog/rzg2l_wdt.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,13 @@ static int rzg2l_wdt_start(struct watchdog_device *wdev)
144144
static int rzg2l_wdt_stop(struct watchdog_device *wdev)
145145
{
146146
struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev);
147+
int ret;
147148

148149
rzg2l_wdt_reset(priv);
149-
pm_runtime_put(wdev->parent);
150+
151+
ret = pm_runtime_put(wdev->parent);
152+
if (ret < 0)
153+
return ret;
150154

151155
return 0;
152156
}
@@ -163,7 +167,10 @@ static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev, unsigned int time
163167
* to reset the module) so that it is updated with new timeout values.
164168
*/
165169
if (watchdog_active(wdev)) {
166-
rzg2l_wdt_stop(wdev);
170+
ret = rzg2l_wdt_stop(wdev);
171+
if (ret)
172+
return ret;
173+
167174
ret = rzg2l_wdt_start(wdev);
168175
}
169176

0 commit comments

Comments
 (0)