From: Artem Shimko <a.shimko.dev@gmail.com>
To: wim@linux-watchdog.org, linux@roeck-us.net,
p.zabel@pengutronix.de, Sergey.Semin@baikalelectronics.ru,
mika.westerberg@linux.intel.com, andi.shyti@kernel.org,
iav@iav.lv
Cc: Artem Shimko <a.shimko.dev@gmail.com>,
linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 3/3] watchdog: dw_wdt: clean up error paths in resume function
Date: Thu, 22 Oct 2026 16:43:51 +0300 [thread overview]
Message-ID: <20261022134354.534642-4-a.shimko.dev@gmail.com> (raw)
In-Reply-To: <20261022134354.534642-1-a.shimko.dev@gmail.com>
Clean up of dw_wdt_resume() function.
Rework the error handling to use properly named labels that match the
cleanup order. Use unprepare_clk for clock disable and unprepare_pclk
for pclk disable path.
Signed-off-by: Artem Shimko <a.shimko.dev@gmail.com>
---
drivers/watchdog/dw_wdt.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
index ec6a09673da4..11caf40d6771 100644
--- a/drivers/watchdog/dw_wdt.c
+++ b/drivers/watchdog/dw_wdt.c
@@ -393,16 +393,15 @@ static int dw_wdt_suspend(struct device *dev)
static int dw_wdt_resume(struct device *dev)
{
struct dw_wdt *dw_wdt = dev_get_drvdata(dev);
- int err = clk_prepare_enable(dw_wdt->clk);
+ int err;
+ err = clk_prepare_enable(dw_wdt->clk);
if (err)
return err;
err = clk_prepare_enable(dw_wdt->pclk);
- if (err) {
- clk_disable_unprepare(dw_wdt->clk);
- return err;
- }
+ if (err)
+ goto unprepare_clk;
err = reset_control_deassert(dw_wdt->rst);
if (err)
@@ -417,6 +416,7 @@ static int dw_wdt_resume(struct device *dev)
unprepare_pclk:
clk_disable_unprepare(dw_wdt->pclk);
+unprepare_clk:
clk_disable_unprepare(dw_wdt->clk);
return err;
--
2.43.0
next prev parent reply other threads:[~2026-10-22 13:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 13:43 [PATCH v2 0/3] watchdog: dw_wdt: fix reset line management Artem Shimko
2026-10-22 13:43 ` [PATCH v2 1/3] watchdog: dw_wdt: use devm_reset_control_get_optional_shared_deasserted Artem Shimko
2026-10-23 3:05 ` Tzung-Bi Shih
[not found] ` <CAOPX745qshBW4NPh8cNt9kGUEtp6C1Ds8HVTjFjL2=q1azrFsw@mail.gmail.com>
2026-10-24 13:19 ` Tzung-Bi Shih
2026-10-22 13:43 ` [PATCH v2 2/3] watchdog: dw_wdt: manage reset line during system suspend/resume Artem Shimko
2026-10-23 3:05 ` Tzung-Bi Shih
2026-10-22 13:43 ` Artem Shimko [this message]
2026-10-23 3:06 ` [PATCH v2 3/3] watchdog: dw_wdt: clean up error paths in resume function Tzung-Bi Shih
2026-10-22 21:15 ` [PATCH v2 0/3] watchdog: dw_wdt: fix reset line management Igor Velkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261022134354.534642-4-a.shimko.dev@gmail.com \
--to=a.shimko.dev@gmail.com \
--cc=Sergey.Semin@baikalelectronics.ru \
--cc=andi.shyti@kernel.org \
--cc=iav@iav.lv \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mika.westerberg@linux.intel.com \
--cc=p.zabel@pengutronix.de \
--cc=wim@linux-watchdog.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.