[PATCH] clk: Allocate and add clock lookups from clk_register()

Viresh Kumar viresh.kumar at st.com
Fri Apr 13 06:10:44 EDT 2012


On 4/13/2012 3:31 PM, Sascha Hauer wrote:
>> > Pointer to original discussion:
>> > http://www.spinics.net/lists/arm-kernel/msg169133.html
> For reasons mentioned in this thread (long argument list, line wraps in
> clk_register calls, only leaf nodes need lookups) I don't think this is
> a good idea.

For that we can pass struct as argument.

>> >   */
>> >  struct clk *clk_register(struct device *dev, const char *name,
>> >  		const struct clk_ops *ops, struct clk_hw *hw,
>> > -		const char **parent_names, u8 num_parents, unsigned long flags)
>> > +		const char **parent_names, u8 num_parents, unsigned long flags,
>> > +		struct clk_lookup **cl, const char *dev_id, const char *con_id)
>> >  {
> Also this doesn't handle the case when multiple lookups are associated
> with a single clock (which is quite a common case on some SoCs). Yes,
> we could still use the returned clk to register the additional lookups,
> but that would make the advantage of this patch even smaller.

If there is a better way of managing this within the clock framework,
without platforms having to do clkdev management, we can choose that.
My main idea was to make platform code lighter.

We can do one more thing here to support multiple lookups for same clocks:
We can pass array of struct having these three args as its fields.

-- 
viresh



More information about the linux-arm-kernel mailing list