Commit cec444b7 authored by Ben Dooks's avatar Ben Dooks

[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: default avatarBen Dooks <ben-linux@fluff.org>
parent 93b45885
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment