[RFC,PATCH 1/7] arm: add a common struct clk

Jeremy Kerr jeremy.kerr at canonical.com
Thu Jan 7 20:20:14 EST 2010


Hi Hartley,

> > +config HAVE_COMMON_STRUCT_CLK
> > +	bool
> > +	default n
> 
> default n is not needed

OK, can remove this.

> Probably should have here, and in all the other functions, something like:
> 
> 	if (!clk)
> 		return -EINVAL;

Is it at all valid to call the clock API functions with a NULL clock?

> Also, is any locking needed?

That's up to the implementer. For example, fixed rate clocks do not require 
locking.

> For clocks that are not configurable it might be a good idea to add:
> 
> 	unsigned long	rate;
> 
> to struct clk and then:
> 
> 	return clk->rate;
> 
> for the non-get_rate() condition.

Check out the clk_fixed patch (2/7), this implements fixed-rate clocks. I'm 
relucant to add anything to struct clock that isn't part of the kernel-wide 
API.

Cheers,


Jeremy



More information about the linux-arm-kernel mailing list