diff options
author | Ben Dooks <ben@ben-laptop.fluff.org> | 2010-01-06 01:07:57 +0900 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-01-15 17:10:11 +0900 |
commit | fb6e76cd2309c76d2120e013ff34ff6ab27aad88 (patch) | |
tree | d799129f90346334135499451f44701303e9e2ca /arch | |
parent | 2c2f69b15d5420291a941ace10149e76f0af7ab0 (diff) |
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: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/plat-samsung/clock-clksrc.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/arch/arm/plat-samsung/clock-clksrc.c b/arch/arm/plat-samsung/clock-clksrc.c index 12129f8e509..aaf7d5ebea9 100644 --- a/arch/arm/plat-samsung/clock-clksrc.c +++ b/arch/arm/plat-samsung/clock-clksrc.c @@ -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) - clksrc->clk.ops = &clksrc_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 |