summaryrefslogtreecommitdiff
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorBiju Das <biju.das.jz@bp.renesas.com>2022-02-25 20:53:18 +0300
committerWim Van Sebroeck <wim@linux-watchdog.org>2022-05-08 11:34:03 +0300
commitbaf1aace9ad15401f08e048a7f1fdec79821bc61 (patch)
treedff4f982909256e2491c30f5dc50d2b13dd9287d /drivers/watchdog
parent33d04d0fdba9fae18c7d58364643d2c606a43dba (diff)
downloadlinux-baf1aace9ad15401f08e048a7f1fdec79821bc61.tar.xz
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 <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-6-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>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/rzg2l_wdt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c
index 88274704b260..73b667ed3e99 100644
--- a/drivers/watchdog/rzg2l_wdt.c
+++ b/drivers/watchdog/rzg2l_wdt.c
@@ -203,7 +203,10 @@ static int rzg2l_wdt_probe(struct platform_device *pdev)
return dev_err_probe(&pdev->dev, PTR_ERR(priv->rstc),
"failed to get cpg reset");
- reset_control_deassert(priv->rstc);
+ ret = reset_control_deassert(priv->rstc);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to deassert");
+
pm_runtime_enable(&pdev->dev);
priv->wdev.info = &rzg2l_wdt_ident;