[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110204132040.GI14627@n2100.arm.linux.org.uk>
Date: Fri, 4 Feb 2011 13:20:40 +0000
From: Russell King - ARM Linux <linux@....linux.org.uk>
To: Richard Zhao <linuxzsc@...il.com>
Cc: Jeremy Kerr <jeremy.kerr@...onical.com>,
Nicolas Pitre <nicolas.pitre@...aro.org>,
Lorenzo Pieralisi <Lorenzo.Pieralisi@....com>,
Saravana Kannan <skannan@...eaurora.org>,
linux-sh@...r.kernel.org,
Ben Herrenschmidt <benh@...nel.crashing.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Paul Mundt <lethal@...ux-sh.org>, linux-kernel@...r.kernel.org,
Dima Zavin <dmitriyz@...gle.com>,
Ben Dooks <ben-linux@...ff.org>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Vincent Guittot <vincent.guittot@...aro.org>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: Locking in the clk API, part 2: clk_prepare/clk_unprepare
On Fri, Feb 04, 2011 at 08:45:34PM +0800, Richard Zhao wrote:
> > == Implementation ==
> >
> > Basically:
> >
> > struct clk {
> > const struct clk_ops *ops
> > int enable_count;
> > spinlock_t enable_lock;
> > int prepare_count;
> > struct mutex prepare_lock;
> > };
> >
> > int clk_enable(struct clk *clk)
> > {
> > int ret = 0;
> >
> > spin_lock(&clk->enable_lock);
> > if (!clk->enable_count)
> > ret = clk->ops->enable(clk);
> >
> > if (!ret)
> > clk->enable_count++;
> > spin_unlock(&clk->enable_lock);
> >
> > return ret;
> > }
> Why do we not call parent's clk_enable in this function? For flexible? How many
> different cases is causing us to move the effert to platform clock driver?
You may notice that struct clk above doesn't have a parent.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists