提交 fb6e76cd 编写于 作者: B Ben Dooks 提交者: Ben Dooks

ARM: SAMSUNG: Do not allow get/set/round rate calls with no divider

If the reg_div field is not set, then do not register clk_ops with the
get/set/round rate calls as these will fail to work.
Signed-off-by: NBen Dooks <ben-linux@fluff.org>
上级 2c2f69b1
......@@ -158,14 +158,25 @@ static struct clk_ops clksrc_ops = {
.round_rate = s3c_roundrate_clksrc,
};
static struct clk_ops clksrc_ops_nodiv = {
.set_parent = s3c_setparent_clksrc,
};
void __init s3c_register_clksrc(struct clksrc_clk *clksrc, int size)
{
int ret;
WARN_ON(!clksrc->reg_div.reg && !clksrc->reg_src.reg);
for (; size > 0; size--, clksrc++) {
/* fill in the default functions */
if (!clksrc->clk.ops)
if (!clksrc->clk.ops) {
if (!clksrc->reg_div.reg)
clksrc->clk.ops = &clksrc_ops_nodiv;
else
clksrc->clk.ops = &clksrc_ops;
}
/* setup the clocksource, but do not announce it
* as it may be re-set by the setup routines
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册