From: Deepak Sikri Date: Sat, 10 Nov 2012 06:43:46 +0000 (+0530) Subject: CLK: SPEAr: Correct index scanning done for clock synths X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1b2d4ad585d5bfb57603aed08e8fab99069e16e7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Viresh Kumar Signed-off-by: Mike Turquette --- 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; }