aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-s3c/clock.c
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2008-10-21 09:07:10 -0400
committerBen Dooks <ben-linux@fluff.org>2008-12-15 16:46:22 -0500
commitcec444b79073e7d6ef35ced5ef63c3fd83d9b9a7 (patch)
treeb366e0f675aa2cdbfc4fbea20dba4e9c2526e309 /arch/arm/plat-s3c/clock.c
parent93b458858f6d40650513f63feef0b350eff4845f (diff)
[ARM] S3C: BUG_ON() if clock has already been registered
Add a simple check when registering a clock on whether the clock has already been added to the list. Any attempt to re-register a clock will cause the clock list to be come looped and thus produces silent failures when looking up clocks. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s3c/clock.c')
-rw-r--r--arch/arm/plat-s3c/clock.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c/clock.c b/arch/arm/plat-s3c/clock.c
index 35249b58f383..da7ac07c7a0b 100644
--- a/arch/arm/plat-s3c/clock.c
+++ b/arch/arm/plat-s3c/clock.c
@@ -304,6 +304,9 @@ int s3c24xx_register_clock(struct clk *clk)
304 304
305 /* add to the list of available clocks */ 305 /* add to the list of available clocks */
306 306
307 /* Quick check to see if this clock has already been registered. */
308 BUG_ON(clk->list.prev != clk->list.next);
309
307 spin_lock(&clocks_lock); 310 spin_lock(&clocks_lock);
308 list_add(&clk->list, &clocks); 311 list_add(&clk->list, &clocks);
309 spin_unlock(&clocks_lock); 312 spin_unlock(&clocks_lock);