From: Heiko Stübner Date: Tue, 24 Feb 2015 10:39:25 +0000 (+0100) Subject: clk: divider: return real rate instead of divider value X-Git-Tag: MMI-PSA29.97-13-9~10460^2~8 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2f7bf4af5c8177f6a27d9b67efdeb48f5bdbf821;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git clk: divider: return real rate instead of divider value 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 Reviewed-by: James Hogan Tested-by: James Hogan Acked-by: Stephen Boyd Signed-off-by: Michael Turquette --- diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c index db7f8bce7467..eff8a862eb08 100644 --- a/drivers/clk/clk-divider.c +++ b/drivers/clk/clk-divider.c @@ -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,