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

Commit f5cb564a authored by Junjie Wu's avatar Junjie Wu
Browse files

clk: qcom: Check CLKFLAG_INIT_DONE flag for clk_get()



clk_get() should not return clock handle unless that clock has been
initialized. Add check for CLKFLAG_INIT_DONE to enforce this
requirement.

Change-Id: I201cf6988c2f5de8c92d1ab48024f1c6bd63b813
Signed-off-by: default avatarJunjie Wu <junjiew@codeaurora.org>
parent d7b84769
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -854,11 +854,15 @@ static struct clk *of_clk_src_get(struct of_phandle_args *clkspec,
				  void *data)
{
	struct of_msm_provider_data *ofdata = data;
	struct clk *c;
	int n;

	for (n = 0; n < ofdata->size; n++) {
		if (clkspec->args[0] == ofdata->table[n].of_idx)
			return ofdata->table[n].clk;
		if (clkspec->args[0] == ofdata->table[n].of_idx) {
			c = ofdata->table[n].clk;
			if (c->flags & CLKFLAG_INIT_DONE)
				return c;
		}
	}
	return ERR_PTR(-ENOENT);
}