Skip to content

Commit

Permalink
CLK: SPEAr: Correct index scanning done for clock synths
Browse files Browse the repository at this point in the history
The patch corrects the case when the rate table is being scanned for a
given frequency, and the search frequency is beyond the maximum
frequency indexed in the table.

By default, the system should be set at max frequency present in the
rate table. This patch correctly returns the corresponding index value.

Signed-off-by: Deepak Sikri <deepak.sikri@st.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
  • Loading branch information
Deepak Sikri authored and Mike Turquette committed Nov 21, 2012
1 parent ef0fd0a commit 1b2d4ad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/clk/spear/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@ long clk_round_rate_index(struct clk_hw *hw, unsigned long drate,
}
}

if ((*index) == rtbl_cnt)
(*index)--;

return rate;
}

0 comments on commit 1b2d4ad

Please sign in to comment.