aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-samsung/clock-clksrc.c
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2009-11-30 20:24:37 -0500
committerBen Dooks <ben-linux@fluff.org>2010-01-15 03:10:10 -0500
commitb3bf41be06634d69959a68a2b53e1ffc92f0d103 (patch)
tree7575fc3d60e9a2f99e74b2862e1b3a43b7df1f92 /arch/arm/plat-samsung/clock-clksrc.c
parent13bbd88504bfa0d205fa4121322869d8d7e083d0 (diff)
ARM: SAMSUNG: Reduce size of struct clk.
Reduce the size of struct clk by 12 bytes and make defining clocks with common implementation functions easier by moving the set_rate, get_rate, round_rate and set_parent calls into a new structure called 'struct clk_ops' and using that instead. This change does make a few clocks larger as they need their own clk_ops, but this is outweighed by the number of clocks with either no ops or having a common set of ops. Update all the users of this. 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.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/arm/plat-samsung/clock-clksrc.c b/arch/arm/plat-samsung/clock-clksrc.c
index 5872f0b62b7c..ad4e8723a811 100644
--- a/arch/arm/plat-samsung/clock-clksrc.c
+++ b/arch/arm/plat-samsung/clock-clksrc.c
@@ -150,20 +150,21 @@ void __init_or_cpufreq s3c_set_clksrc(struct clksrc_clk *clk)
150 clk_get_rate(&clk->clk)); 150 clk_get_rate(&clk->clk));
151} 151}
152 152
153static struct clk_ops clksrc_ops = {
154 .set_parent = s3c_setparent_clksrc,
155 .get_rate = s3c_getrate_clksrc,
156 .set_rate = s3c_setrate_clksrc,
157 .round_rate = s3c_roundrate_clksrc,
158};
159
153void __init s3c_register_clksrc(struct clksrc_clk *clksrc, int size) 160void __init s3c_register_clksrc(struct clksrc_clk *clksrc, int size)
154{ 161{
155 int ret; 162 int ret;
156 163
157 for (; size > 0; size--, clksrc++) { 164 for (; size > 0; size--, clksrc++) {
158 /* fill in the default functions */ 165 /* fill in the default functions */
159 if (!clksrc->clk.set_parent) 166 if (!clksrc->clk.ops)
160 clksrc->clk.set_parent = s3c_setparent_clksrc; 167 clksrc->clk.ops = &clksrc_ops;
161 if (!clksrc->clk.get_rate)
162 clksrc->clk.get_rate = s3c_getrate_clksrc;
163 if (!clksrc->clk.set_rate)
164 clksrc->clk.set_rate = s3c_setrate_clksrc;
165 if (!clksrc->clk.round_rate)
166 clksrc->clk.round_rate = s3c_roundrate_clksrc;
167 168
168 s3c_set_clksrc(clksrc); 169 s3c_set_clksrc(clksrc);
169 170