Skip to content

Commit

Permalink
clk: clk_set_rate() must fail if CLK_SET_RATE_GATE is set and clk is …
Browse files Browse the repository at this point in the history
…enabled

This is well documented but isn't implemented. clk_set_rate() must check if
flags have CLK_SET_RATE_GATE bit set and is enabled too.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
  • Loading branch information
Viresh Kumar authored and Mike Turquette committed May 2, 2012
1 parent 0197b3e commit 0e1c030
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,11 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
if (rate == clk->rate)
goto out;

if ((clk->flags & CLK_SET_RATE_GATE) && __clk_is_enabled(clk)) {
ret = -EBUSY;
goto out;
}

/* calculate new rates and get the topmost changed clock */
top = clk_calc_new_rates(clk, rate);
if (!top) {
Expand Down

0 comments on commit 0e1c030

Please sign in to comment.