aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-samsung/clock-clksrc.c
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2010-01-05 11:53:25 -0500
committerBen Dooks <ben-linux@fluff.org>2010-01-15 03:10:11 -0500
commit14235696d401e62f8f5740ca2fb917ab42b9fd18 (patch)
tree589435ed94d617bd0c03c764ef96b87e958fde76 /arch/arm/plat-samsung/clock-clksrc.c
parent1d9f13c49ed750260f40317629bdd66160a3ac16 (diff)
ARM: SAMSUNG: Do not register set_parent call if no source
If there is no source register defined, do not register a clksrc clock with a valid .set_parent in the ops. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-samsung/clock-clksrc.c')
-rw-r--r--arch/arm/plat-samsung/clock-clksrc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/arm/plat-samsung/clock-clksrc.c b/arch/arm/plat-samsung/clock-clksrc.c
index aaf7d5ebea96..33c633a8be8d 100644
--- a/arch/arm/plat-samsung/clock-clksrc.c
+++ b/arch/arm/plat-samsung/clock-clksrc.c
@@ -86,7 +86,7 @@ static int s3c_setparent_clksrc(struct clk *clk, struct clk *parent)
86 break; 86 break;
87 } 87 }
88 88
89 if (src_nr >= 0 && sclk->reg_src.reg) { 89 if (src_nr >= 0) {
90 clk->parent = parent; 90 clk->parent = parent;
91 91
92 clksrc &= ~mask; 92 clksrc &= ~mask;
@@ -162,6 +162,12 @@ static struct clk_ops clksrc_ops_nodiv = {
162 .set_parent = s3c_setparent_clksrc, 162 .set_parent = s3c_setparent_clksrc,
163}; 163};
164 164
165static struct clk_ops clksrc_ops_nosrc = {
166 .get_rate = s3c_getrate_clksrc,
167 .set_rate = s3c_setrate_clksrc,
168 .round_rate = s3c_roundrate_clksrc,
169};
170
165void __init s3c_register_clksrc(struct clksrc_clk *clksrc, int size) 171void __init s3c_register_clksrc(struct clksrc_clk *clksrc, int size)
166{ 172{
167 int ret; 173 int ret;
@@ -174,6 +180,8 @@ void __init s3c_register_clksrc(struct clksrc_clk *clksrc, int size)
174 if (!clksrc->clk.ops) { 180 if (!clksrc->clk.ops) {
175 if (!clksrc->reg_div.reg) 181 if (!clksrc->reg_div.reg)
176 clksrc->clk.ops = &clksrc_ops_nodiv; 182 clksrc->clk.ops = &clksrc_ops_nodiv;
183 else if (!clksrc->reg_src.reg)
184 clksrc->clk.ops = &clksrc_ops_nosrc;
177 else 185 else
178 clksrc->clk.ops = &clksrc_ops; 186 clksrc->clk.ops = &clksrc_ops;
179 } 187 }