From: Russell King <[email protected]>

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 <[email protected]>
---
 arch/arm/plat-omap/clock.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index df58f5d..6b3ef2a 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -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)
-- 
1.6.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to