From: Ben Dooks Date: Tue, 21 Oct 2008 13:07:10 +0000 (+0100) Subject: [ARM] S3C: BUG_ON() if clock has already been registered X-Git-Tag: upstream/snapshot3+hdmi~21147^2~9^2~10^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cec444b79073e7d6ef35ced5ef63c3fd83d9b9a7;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git [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 --- diff --git a/arch/arm/plat-s3c/clock.c b/arch/arm/plat-s3c/clock.c index 35249b5..da7ac07 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) /* 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);