diff options
author | Deepak Sikri <deepak.sikri@st.com> | 2012-11-10 12:13:46 +0530 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2012-11-21 11:46:06 -0800 |
commit | 1b2d4ad585d5bfb57603aed08e8fab99069e16e7 (patch) | |
tree | fdae9f0f1453f53b282d3c5fa525a63a4cd6ce3e /drivers/clk | |
parent | ef0fd0a207c00b09449f33724322ba762d822d97 (diff) | |
download | talos-obmc-linux-1b2d4ad585d5bfb57603aed08e8fab99069e16e7.tar.gz talos-obmc-linux-1b2d4ad585d5bfb57603aed08e8fab99069e16e7.zip |
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>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/spear/clk.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/clk/spear/clk.c b/drivers/clk/spear/clk.c index 7cd63788d546..628b6d5ed3d9 100644 --- a/drivers/clk/spear/clk.c +++ b/drivers/clk/spear/clk.c @@ -32,5 +32,8 @@ long clk_round_rate_index(struct clk_hw *hw, unsigned long drate, } } + if ((*index) == rtbl_cnt) + (*index)--; + return rate; } |