Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d00d19b1 authored by Mona Hossain's avatar Mona Hossain
Browse files

crypto: msm: Fix clk initialization



Return clk_get error for core_src_clk
Remove enabling other clks for targets that need only core_src_clk

Change-Id: I4749b9f9fff1d6057dbc46aa1bd4c7e50a801ed8
Signed-off-by: default avatarMona Hossain <mhossain@codeaurora.org>
parent c4b871ac
Loading
Loading
Loading
Loading
+23 −15
Original line number Diff line number Diff line
@@ -5257,13 +5257,22 @@ static int __qce_init_clk(struct qce_device *pce_dev)
					pce_dev->ce_opp_freq_hz/CE_CLK_DIV);
			goto exit_put_core_src_clk;
		}
	} else {
		if (pce_dev->support_only_core_src_clk) {
			rc = PTR_ERR(pce_dev->ce_core_src_clk);
			pce_dev->ce_core_src_clk = NULL;
			pr_err("Unable to get CE core src clk\n");
			return rc;
		} else {
			pr_warn("Unable to get CE core src clk, set to NULL\n");
			pce_dev->ce_core_src_clk = NULL;
		}
	}

	if (pce_dev->support_only_core_src_clk) {
		pce_dev->ce_core_clk = NULL;
		pce_dev->ce_clk = NULL;
		pce_dev->ce_bus_clk = NULL;
	} else {
		pce_dev->ce_core_clk = clk_get(pce_dev->pdev, "core_clk");
		if (IS_ERR(pce_dev->ce_core_clk)) {
@@ -5271,8 +5280,6 @@ static int __qce_init_clk(struct qce_device *pce_dev)
			pr_err("Unable to get CE core clk\n");
			goto exit_put_core_src_clk;
		}
	}

		pce_dev->ce_clk = clk_get(pce_dev->pdev, "iface_clk");
		if (IS_ERR(pce_dev->ce_clk)) {
			rc = PTR_ERR(pce_dev->ce_clk);
@@ -5286,6 +5293,7 @@ static int __qce_init_clk(struct qce_device *pce_dev)
			pr_err("Unable to get CE BUS interface clk\n");
			goto exit_put_iface_clk;
		}
	}
	return rc;

exit_put_iface_clk: