From: Andrew Bresticker Date: Fri, 27 Dec 2013 00:44:27 +0000 (-0800) Subject: clk: tegra: use max divider if divider overflows X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3de5bdfb4cb3bd99052a4ffaee358189779be042;p=linux-beck.git clk: tegra: use max divider if divider overflows When requesting a rate less than the minimum clock rate for a divider, use the maximum divider value instead of bailing out with an error. This matches the behavior of the generic clock divider. Signed-off-by: Andrew Bresticker --- diff --git a/drivers/clk/tegra/clk-divider.c b/drivers/clk/tegra/clk-divider.c index 4d75b1f37e3a..290f9c1a3749 100644 --- a/drivers/clk/tegra/clk-divider.c +++ b/drivers/clk/tegra/clk-divider.c @@ -59,7 +59,7 @@ static int get_div(struct tegra_clk_frac_div *divider, unsigned long rate, return 0; if (divider_ux1 > get_max_div(divider)) - return -EINVAL; + return get_max_div(divider); return divider_ux1; }