clk: divider: return real rate instead of divider value
authorHeiko Stübner <heiko@sntech.de>
Tue, 24 Feb 2015 10:39:25 +0000 (11:39 +0100)
committerMichael Turquette <mturquette@linaro.org>
Fri, 6 Mar 2015 17:25:13 +0000 (09:25 -0800)
Commit bca9690b9426 ("clk: divider: Make generic for usage elsewhere")
returned only the divider value for read-only dividers instead of the
actual rate.

Fixes: bca9690b9426 ("clk: divider: Make generic for usage elsewhere")
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Tested-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
drivers/clk/clk-divider.c

index db7f8bce7467a2abfd37f6ccb8e22c784a6bce28..eff8a862eb0829477874e066e73273f4b0d38621 100644 (file)
@@ -353,7 +353,7 @@ static long clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
                bestdiv = readl(divider->reg) >> divider->shift;
                bestdiv &= div_mask(divider->width);
                bestdiv = _get_div(divider->table, bestdiv, divider->flags);
-               return bestdiv;
+               return DIV_ROUND_UP(*prate, bestdiv);
        }
 
        return divider_round_rate(hw, rate, prate, divider->table,