On Thu, Feb 10, 2011 at 09:21:14AM +1300, Ryan Mallon wrote:On 02/09/2011 07:41 PM, Jeremy Kerr wrote:[...]
Hi Jeremy,
Couple more comments below.
~Ryan
It's possible to be NULL. So are set_rate/get_rate.+int clk_enable(struct clk *clk)WARN_ON(clk->prepare_count == 0); ?
+{
+ unsigned long flags;
+ int ret = 0;
+
+ spin_lock_irqsave(&clk->enable_lock, flags);
+ if (clk->enable_count == 0&& clk->ops->enable)Does it make sense to have a clock with no enable function which still
+ ret = clk->ops->enable(clk);
returns success from clk_enable? Do we have any platforms which have
NULL clk_enable functions?
I think that for enable/disable at least we should require platforms to
provide functions and oops if they have failed to do so. In the rare
case that a platform doesn't need to do anything for enable/disable they
can just supply empty functions.
Ideally, if it's NULL:
prepare/unprepare: only call parent's prepare/unprepare
enable/disable: only call parent's enable/disable