Commit 2f7bf4af authored by Heiko Stübner's avatar Heiko Stübner Committed by Michael Turquette

clk: divider: return real rate instead of divider value

Commit bca9690b ("clk: divider: Make generic for usage elsewhere")
returned only the divider value for read-only dividers instead of the
actual rate.

Fixes: bca9690b ("clk: divider: Make generic for usage elsewhere")
Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
Reviewed-by: default avatarJames Hogan <james.hogan@imgtec.com>
Tested-by: default avatarJames Hogan <james.hogan@imgtec.com>
Acked-by: default avatarStephen Boyd <sboyd@codeaurora.org>
Signed-off-by: default avatarMichael Turquette <mturquette@linaro.org>
parent a456fe3d
...@@ -353,7 +353,7 @@ static long clk_divider_round_rate(struct clk_hw *hw, unsigned long rate, ...@@ -353,7 +353,7 @@ static long clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
bestdiv = readl(divider->reg) >> divider->shift; bestdiv = readl(divider->reg) >> divider->shift;
bestdiv &= div_mask(divider->width); bestdiv &= div_mask(divider->width);
bestdiv = _get_div(divider->table, bestdiv, divider->flags); 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, return divider_round_rate(hw, rate, prate, divider->table,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment