From: Russell King Date: Thu, 22 Jan 2009 16:08:04 +0000 (+0000) Subject: [ARM] omap: allow double-registering of clocks X-Git-Tag: firefly_0821_release~15211^2~20^2~69 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=dbb674d57b5851a4fe3122ff4280e4cf87209198;p=firefly-linux-kernel-4.4.55.git [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 --- diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index df58f5d9a5ab..6b3ef2a0b04e 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)