From: Gaosheng Cui <cuigaosheng1@huawei.com>
To: <andersson@kernel.org>, <baolin.wang@linux.alibaba.com>,
<mcoquelin.stm32@gmail.com>, <alexandre.torgue@foss.st.com>,
<cuigaosheng1@huawei.com>
Cc: <linux-remoteproc@vger.kernel.org>,
<linux-stm32@st-md-mailman.stormreply.com>,
<linux-arm-kernel@lists.infradead.org>
Subject: [PATCH -next] hwspinlock: stm32: Add missing clk_disable_unprepare in stm32_hwspinlock_probe
Date: Sat, 3 Aug 2024 14:14:43 +0800 [thread overview]
Message-ID: <20240803061443.287117-1-cuigaosheng1@huawei.com> (raw)
Add the missing clk_disable_unprepare() before return in
stm32_hwspinlock_probe().
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
---
drivers/hwspinlock/stm32_hwspinlock.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/hwspinlock/stm32_hwspinlock.c b/drivers/hwspinlock/stm32_hwspinlock.c
index bb5c7e5f7a80..a4e3b9a9e29d 100644
--- a/drivers/hwspinlock/stm32_hwspinlock.c
+++ b/drivers/hwspinlock/stm32_hwspinlock.c
@@ -103,6 +103,7 @@ static int stm32_hwspinlock_probe(struct platform_device *pdev)
ret = devm_add_action_or_reset(dev, stm32_hwspinlock_disable_clk, pdev);
if (ret) {
dev_err(dev, "Failed to register action\n");
+ clk_disable_unprepare(hw->clk);
return ret;
}
@@ -112,8 +113,10 @@ static int stm32_hwspinlock_probe(struct platform_device *pdev)
ret = devm_hwspin_lock_register(dev, &hw->bank, &stm32_hwspinlock_ops,
0, STM32_MUTEX_NUM_LOCKS);
- if (ret)
+ if (ret) {
dev_err(dev, "Failed to register hwspinlock\n");
+ clk_disable_unprepare(hw->clk);
+ }
return ret;
}
--
2.25.1
next reply other threads:[~2024-08-03 6:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-03 6:14 Gaosheng Cui [this message]
2024-08-08 1:37 ` [PATCH -next] hwspinlock: stm32: Add missing clk_disable_unprepare in stm32_hwspinlock_probe Baolin Wang
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=20240803061443.287117-1-cuigaosheng1@huawei.com \
--to=cuigaosheng1@huawei.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andersson@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).