clk: rockchip: fix up the rockchip_fractional_approximation

If frac clk parent rate is PLL rate, but still lower
than frac rate*20, not allowed fractional div.

Change-Id: I09c93e1d8f32c0a4e345057964d58505b1477204
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
This commit is contained in:
Elaine Zhang
2017-09-20 10:22:59 +08:00
committed by Tao Huang
parent 6732ca7f09
commit 7a3a77f1ac

View File

@@ -195,6 +195,11 @@ static void rockchip_fractional_approximation(struct clk_hw *hw,
p_parent = clk_hw_get_parent(clk_hw_get_parent(hw));
p_parent_rate = clk_hw_get_rate(p_parent);
*parent_rate = p_parent_rate;
if (*parent_rate < rate * 20) {
pr_err("%s parent_rate(%ld) is low than rate(%ld)*20, fractional div is not allowed\n",
clk_hw_get_name(hw), *parent_rate, rate);
return;
}
}
/*