aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Dooks <ben@ben-laptop.fluff.org>2010-01-05 11:07:57 -0500
committerBen Dooks <ben-linux@fluff.org>2010-01-15 03:10:11 -0500
commitfb6e76cd2309c76d2120e013ff34ff6ab27aad88 (patch)
treed799129f90346334135499451f44701303e9e2ca
parent2c2f69b15d5420291a941ace10149e76f0af7ab0 (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>
-rw-r--r--arch/arm/plat-samsung/clock-clksrc.c15
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 12129f8e509c..aaf7d5ebea96 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 = {
158 .round_rate = s3c_roundrate_clksrc, 158 .round_rate = s3c_roundrate_clksrc,
159}; 159};
160 160
161static struct clk_ops clksrc_ops_nodiv = {
162 .set_parent = s3c_setparent_clksrc,
163};
164
161void __init s3c_register_clksrc(struct clksrc_clk *clksrc, int size) 165void __init s3c_register_clksrc(struct clksrc_clk *clksrc, int size)
162{ 166{
163 int ret; 167 int ret;
164 168
169 WARN_ON(!clksrc->reg_div.reg && !clksrc->reg_src.reg);
170
165 for (; size > 0; size--, clksrc++) { 171 for (; size > 0; size--, clksrc++) {
166 /* fill in the default functions */ 172 /* fill in the default functions */
167 if (!clksrc->clk.ops) 173
168 clksrc->clk.ops = &clksrc_ops; 174 if (!clksrc->clk.ops) {
175 if (!clksrc->reg_div.reg)
176 clksrc->clk.ops = &clksrc_ops_nodiv;
177 else
178 clksrc->clk.ops = &clksrc_ops;
179 }
169 180
170 /* setup the clocksource, but do not announce it 181 /* setup the clocksource, but do not announce it
171 * as it may be re-set by the setup routines 182 * as it may be re-set by the setup routines