提交 4e7d30db 编写于 作者: H Hauke Mehrtens 提交者: Ralf Baechle

MIPS: lantiq: add clk_round_rate()

This adds a basic implementation of clk_round_rate()
The clk_round_rate() function is called by multiple drivers and
subsystems now and the lantiq clk driver is supposed to export this,
but doesn't do so, this causes linking problems like this one:
ERROR: "clk_round_rate" [drivers/media/v4l2-core/videodev.ko] undefined!
Signed-off-by: NHauke Mehrtens <hauke@hauke-m.de>
Acked-by: NJohn Crispin <blogic@openwrt.org>
Cc: <stable@vger.kernel.org> # 4.1+
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11358/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 f25319d2
...@@ -99,6 +99,23 @@ int clk_set_rate(struct clk *clk, unsigned long rate) ...@@ -99,6 +99,23 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
} }
EXPORT_SYMBOL(clk_set_rate); EXPORT_SYMBOL(clk_set_rate);
long clk_round_rate(struct clk *clk, unsigned long rate)
{
if (unlikely(!clk_good(clk)))
return 0;
if (clk->rates && *clk->rates) {
unsigned long *r = clk->rates;
while (*r && (*r != rate))
r++;
if (!*r) {
return clk->rate;
}
}
return rate;
}
EXPORT_SYMBOL(clk_round_rate);
int clk_enable(struct clk *clk) int clk_enable(struct clk *clk)
{ {
if (unlikely(!clk_good(clk))) if (unlikely(!clk_good(clk)))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册