All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Yingliang <yangyingliang@huawei.com>
To: <linux-arm-msm@vger.kernel.org>
Cc: <agross@kernel.org>, <andersson@kernel.org>,
	<konrad.dybcio@linaro.org>, <luca@z3ntu.xyz>,
	<yangyingliang@huawei.com>
Subject: [PATCH -next] soc: qcom: ocmem: add missing clk_disable_unprepare() in ocmem_dev_probe()
Date: Wed, 2 Aug 2023 10:48:55 +0800	[thread overview]
Message-ID: <20230802024855.2521895-1-yangyingliang@huawei.com> (raw)

Add clk_disable_unprepare(core_clk) when enable iface_clk failed.

Fixes: a7e12e7bda08 ("soc: qcom: ocmem: make iface clock optional")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/soc/qcom/ocmem.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c
index 6edc18b211aa..20f5461d46b9 100644
--- a/drivers/soc/qcom/ocmem.c
+++ b/drivers/soc/qcom/ocmem.c
@@ -341,12 +341,14 @@ static int ocmem_dev_probe(struct platform_device *pdev)
 	ret = clk_prepare_enable(ocmem->core_clk);
 	if (ret)
 		return dev_err_probe(ocmem->dev, ret, "Failed to enable core clock\n");
 
 	ret = clk_prepare_enable(ocmem->iface_clk);
-	if (ret)
+	if (ret) {
+		clk_disable_unprepare(ocmem->core_clk);
 		return dev_err_probe(ocmem->dev, ret, "Failed to enable iface clock\n");
+	}
 
 	if (qcom_scm_restore_sec_cfg_available()) {
 		dev_dbg(dev, "configuring scm\n");
 		ret = qcom_scm_restore_sec_cfg(QCOM_SCM_OCMEM_DEV_ID, 0);
 		if (ret) {
-- 
2.25.1


             reply	other threads:[~2023-08-02  2:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-02  2:48 Yang Yingliang [this message]
2023-08-03 16:38 ` [PATCH -next] soc: qcom: ocmem: add missing clk_disable_unprepare() in ocmem_dev_probe() Bjorn Andersson

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=20230802024855.2521895-1-yangyingliang@huawei.com \
    --to=yangyingliang@huawei.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=luca@z3ntu.xyz \
    /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.