9
0
Fork 0

clk: implement clk_round_rate

Instead of returning just the current rate implement clk_round_rate
properly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2014-03-13 09:14:38 +01:00
parent 57eb30b265
commit 3d937ce312
1 changed files with 10 additions and 0 deletions

View File

@ -104,9 +104,19 @@ unsigned long clk_get_rate(struct clk *clk)
long clk_round_rate(struct clk *clk, unsigned long rate)
{
unsigned long parent_rate = 0;
struct clk *parent;
if (IS_ERR(clk))
return 0;
parent = clk_get_parent(clk);
if (parent)
parent_rate = clk_get_rate(parent);
if (clk->ops->round_rate)
return clk->ops->round_rate(clk, rate, &parent_rate);
return clk_get_rate(clk);
}