Skip to content

Commit

Permalink
[ARM] S3C: BUG_ON() if clock has already been registered
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Dooks committed Dec 15, 2008
1 parent 93b4588 commit cec444b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/arm/plat-s3c/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cec444b

Please sign in to comment.