aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/clock.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-01-22 11:08:04 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-02-08 12:50:12 -0500
commitdbb674d57b5851a4fe3122ff4280e4cf87209198 (patch)
tree9cb4c4fba2c6ce395308dc696a06082f2ea5183a /arch/arm/plat-omap/clock.c
parent1e98ffa85e70f423e2e41156cc3d549c353cd897 (diff)
[ARM] omap: allow double-registering of clocks
This stops things blowing up if a 'struct clk' to be passed more than once to clk_register(), which will be required when we decouple struct clk's from their names. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/plat-omap/clock.c')
-rw-r--r--arch/arm/plat-omap/clock.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index df58f5d9a5ab..6b3ef2a0b04e 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -292,6 +292,12 @@ int clk_register(struct clk *clk)
292 if (clk == NULL || IS_ERR(clk)) 292 if (clk == NULL || IS_ERR(clk))
293 return -EINVAL; 293 return -EINVAL;
294 294
295 /*
296 * trap out already registered clocks
297 */
298 if (clk->node.next || clk->node.prev)
299 return 0;
300
295 mutex_lock(&clocks_mutex); 301 mutex_lock(&clocks_mutex);
296 list_add(&clk->node, &clocks); 302 list_add(&clk->node, &clocks);
297 if (clk->init) 303 if (clk->init)