Commit 023bd716 authored by Shawn Lin's avatar Shawn Lin Committed by Stephen Boyd

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: default avatarShawn Lin <>
[ s/drgrees/degrees/ in commit text]
Signed-off-by: default avatarStephen Boyd <>
parent 2103a215
......@@ -1841,6 +1841,10 @@ int clk_set_phase(struct clk *clk, int degrees)
/* bail early if nothing to do */
if (degrees == clk->core->phase)
goto out;
trace_clk_set_phase(clk->core, degrees);
if (clk->core->ops->set_phase)
......@@ -1851,6 +1855,7 @@ int clk_set_phase(struct clk *clk, int degrees)
if (!ret)
clk->core->phase = degrees;
return ret;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment