Subject: [PATCH v6 2/3] clk: introduce the common clock framework

From: [email-masked] (Rob Herring)
Date: Tue, 13 Mar 2012 16:48:00 -0500

Mike,

On 03/10/2012 01:54 AM, Mike Turquette wrote:
> The common clock framework defines a common struct clk useful across
> most platforms as well as an implementation of the clk api that drivers
> can use safely for managing clocks.
> 
> The net result is consolidation of many different struct clk definitions
> and platform-specific clock framework implementations.
> 
> This patch introduces the common struct clk, struct clk_ops and an
> implementation of the well-known clock api in include/clk/clk.h.
> Platforms may define their own hardware-specific clock structure and
> their own clock operation callbacks, so long as it wraps an instance of
> struct clk_hw.
> 
> See Documentation/clk.txt for more details.
> 
> This patch is based on the work of Jeremy Kerr, which in turn was based
> on the work of Ben Herrenschmidt.
> 
> Signed-off-by: Mike Turquette <[email-masked]>
> Signed-off-by: Mike Turquette <[email-masked]>
> Cc: Russell King <[email-masked]>
> Cc: Jeremy Kerr <[email-masked]>
> Cc: Thomas Gleixner <[email-masked]>
> Cc: Arnd Bergman <[email-masked]>
> Cc: Paul Walmsley <[email-masked]>
> Cc: Shawn Guo <[email-masked]>
> Cc: Sascha Hauer <[email-masked]>
> Cc: Richard Zhao <[email-masked]>
> Cc: Saravana Kannan <[email-masked]>
> Cc: Magnus Damm <[email-masked]>
> Cc: Rob Herring <[email-masked]>
> Cc: Mark Brown <[email-masked]>
> Cc: Linus Walleij <[email-masked]>
> Cc: Stephen Boyd <[email-masked]>
> Cc: Amit Kucheria <[email-masked]>
> Cc: Deepak Saxena <[email-masked]>
> Cc: Grant Likely <[email-masked]>
> Cc: Andrew Lunn <[email-masked]>

snip

> +
> +	/*
> +	 * walk the list of orphan clocks and reparent any that are children of
> +	 * this clock
> +	 */
> +	hlist_for_each_entry(orphan, tmp, &clk_orphan_list, child_node)

In __clk_init, this needs to be hlist_for_each_entry_safe as entries can
be removed.

Rob