diff mbox series

[-next] soc: qcom: ocmem: add missing clk_disable_unprepare() in ocmem_dev_probe()

Message ID 20230802024855.2521895-1-yangyingliang@huawei.com
State New
Headers show
Series [-next] soc: qcom: ocmem: add missing clk_disable_unprepare() in ocmem_dev_probe() | expand

Commit Message

Yang Yingliang Aug. 2, 2023, 2:48 a.m. UTC
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(-)

Comments

Bjorn Andersson Aug. 3, 2023, 4:38 p.m. UTC | #1
On Wed, 02 Aug 2023 10:48:55 +0800, Yang Yingliang wrote:
> Add clk_disable_unprepare(core_clk) when enable iface_clk failed.
> 
> 

Applied, thanks!

[1/1] soc: qcom: ocmem: add missing clk_disable_unprepare() in ocmem_dev_probe()
      commit: 4d6e0a1bf8f7a6b44d20162e29a87d0bd9526bb0

Best regards,
diff mbox series

Patch

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) {