diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-10-21 14:07:10 +0100 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2008-10-21 14:12:26 +0100 |
commit | a2febfae1062a083bb84750417bc34104638e7cc (patch) | |
tree | f855e584af7cfbd4ad2a4c0dbe3c08993ba3ca5d | |
parent | dd280b291f280889c9e12108f7bc31aebe9ac44d (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>
-rw-r--r-- | arch/arm/plat-s3c/clock.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c/clock.c b/arch/arm/plat-s3c/clock.c index 742318afb54..1054d18828f 100644 --- a/arch/arm/plat-s3c/clock.c +++ b/arch/arm/plat-s3c/clock.c @@ -314,6 +314,9 @@ int s3c24xx_register_clock(struct clk *clk) /* add to the list of available clocks */ + /* Quick check to see if this clock has already been registered. */ + BUG_ON(clk->list.prev != clk->list.next); + spin_lock(&clocks_lock); list_add(&clk->list, &clocks); spin_unlock(&clocks_lock); |