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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux