UPSTREAM: 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>
(cherry picked from git.kernel.org clk/linux.git clk-next
commit 023bd7166b)
Change-Id: Icc3be314e8f696a18bf0cd92867cd5f956817bbc
This commit is contained in:
parent
0c268bf997
commit
c0eebf54ca
1 changed files with 5 additions and 0 deletions
|
|
@ -1902,6 +1902,10 @@ int clk_set_phase(struct clk *clk, int degrees)
|
|||
|
||||
clk_prepare_lock();
|
||||
|
||||
/* 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)
|
||||
|
|
@ -1912,6 +1916,7 @@ int clk_set_phase(struct clk *clk, int degrees)
|
|||
if (!ret)
|
||||
clk->core->phase = degrees;
|
||||
|
||||
out:
|
||||
clk_prepare_unlock();
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue