[PATCH 01/10] Add a common struct clk

Sascha Hauer s.hauer at pengutronix.de
Wed May 4 02:40:15 EDT 2011


On Mon, May 02, 2011 at 05:22:01PM -0700, Saravana Kannan wrote:
> >This does bring us to an interesting question though: should clk_set_rate()
> >succeed or fail with a NULL clk?  There is no clock to control, so my
> >feeling is that it should fail, just like clk_get_rate() should return
> >zero because the rate is meaningless.  There is no rate to get and no
> >rate to set.
> 
> I think having NULL clocks return success on set_rate() would be
> more useful. The most common use case for NULL clocks is when a
> clocks is present in some soc/arch/mach but is not present in
> another. Instead of having the consumers having an "if" around every
> clk_* calls on that clk, they would get a NULL clk. If NULL clk
> starts failing for clk_set_rate(), I think the point of a NULL clk
> will get defeated.



More information about the linux-arm-kernel mailing list