CLK: SPEAr: Correct index scanning done for clock synths

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>
This commit is contained in:
Deepak Sikri 2012-11-10 12:13:46 +05:30 committed by Mike Turquette
parent ef0fd0a207
commit 1b2d4ad585
1 changed files with 3 additions and 0 deletions

View File

@ -32,5 +32,8 @@ long clk_round_rate_index(struct clk_hw *hw, unsigned long drate,
}
}
if ((*index) == rtbl_cnt)
(*index)--;
return rate;
}