]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[ARM] S3C: BUG_ON() if clock has already been registered
authorBen Dooks <ben-linux@fluff.org>
Tue, 21 Oct 2008 13:07:10 +0000 (14:07 +0100)
committerBen Dooks <ben-linux@fluff.org>
Mon, 15 Dec 2008 21:46:22 +0000 (21:46 +0000)
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>
arch/arm/plat-s3c/clock.c

index 35249b58f3837f41cac2d63c36944d2f31a87ce1..da7ac07c7a0b055435724a35c7f76b27fcb7a619 100644 (file)
@@ -304,6 +304,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);