mirror of
https://github.com/torvalds/linux.git
synced 2024-12-30 06:41:43 +00:00
[ARM] omap: allow double-registering of clocks
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>
This commit is contained in:
parent
1e98ffa85e
commit
dbb674d57b
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user