kernel/drivers/clk/sprd/pll.c
.. .. @@ -87,11 +87,12 @@ 87 87 { 88 88 u32 i, num = table[0]; 89 89 90 - for (i = 1; i < num + 1; i++)91 - if (rate <= table[i])90 + /* table[0] indicates the number of items in this table */91 + for (i = 0; i < num; i++)92 + if (rate <= table[i + 1])92 93 break; 93 94 94 - return (i == num + 1) ? num : i;95 + return i == num ? num - 1 : i;95 96 } 96 97 97 98 static unsigned long _sprd_pll_recalc_rate(const struct sprd_pll *pll,