Skip to content

Commit baf1aac

Browse files
bijudasWim Van Sebroeck
authored andcommitted
watchdog: rzg2l_wdt: Add error check for reset_control_deassert
If reset_control_deassert() fails, then we won't be able to access the device registers. Therefore check the return code of reset_control_deassert() and bailout in case of error. 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]>
1 parent 33d04d0 commit baf1aac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/watchdog/rzg2l_wdt.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@ static int rzg2l_wdt_probe(struct platform_device *pdev)
203203
return dev_err_probe(&pdev->dev, PTR_ERR(priv->rstc),
204204
"failed to get cpg reset");
205205

206-
reset_control_deassert(priv->rstc);
206+
ret = reset_control_deassert(priv->rstc);
207+
if (ret)
208+
return dev_err_probe(dev, ret, "failed to deassert");
209+
207210
pm_runtime_enable(&pdev->dev);
208211

209212
priv->wdev.info = &rzg2l_wdt_ident;

0 commit comments

Comments
 (0)