Skip to content

Commit

Permalink
[ARM] omap: allow double-registering of clocks
Browse files Browse the repository at this point in the history
This stops things blowing up if a 'struct clk' to be passed more
than once to clk_register(), which will be required when we decouple
struct clk's from their names.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Feb 8, 2009
1 parent 1e98ffa commit dbb674d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/arm/plat-omap/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,12 @@ int clk_register(struct clk *clk)
if (clk == NULL || IS_ERR(clk))
return -EINVAL;

/*
* trap out already registered clocks
*/
if (clk->node.next || clk->node.prev)
return 0;

mutex_lock(&clocks_mutex);
list_add(&clk->node, &clocks);
if (clk->init)
Expand Down

0 comments on commit dbb674d

Please sign in to comment.