mirror of https://gitee.com/openkylin/linux.git
clk: skip unnecessary set_phase if nothing to do
Let's compare the degrees from clk_set_rate with clk->core->phase. If the requested degrees is already there, skip the following steps. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> [sboyd@codeaurora.org: s/drgrees/degrees/ in commit text] Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This commit is contained in:
parent
2103a21561
commit
023bd7166b
|
@ -1841,6 +1841,10 @@ int clk_set_phase(struct clk *clk, int degrees)
|
||||||
|
|
||||||
clk_prepare_lock();
|
clk_prepare_lock();
|
||||||
|
|
||||||
|
/* bail early if nothing to do */
|
||||||
|
if (degrees == clk->core->phase)
|
||||||
|
goto out;
|
||||||
|
|
||||||
trace_clk_set_phase(clk->core, degrees);
|
trace_clk_set_phase(clk->core, degrees);
|
||||||
|
|
||||||
if (clk->core->ops->set_phase)
|
if (clk->core->ops->set_phase)
|
||||||
|
@ -1851,6 +1855,7 @@ int clk_set_phase(struct clk *clk, int degrees)
|
||||||
if (!ret)
|
if (!ret)
|
||||||
clk->core->phase = degrees;
|
clk->core->phase = degrees;
|
||||||
|
|
||||||
|
out:
|
||||||
clk_prepare_unlock();
|
clk_prepare_unlock();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue