From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: mxc: utilise usecount field in clock operations
Date: Thu, 22 Apr 2010 16:37:44 +0200 [thread overview]
Message-ID: <20100422143744.GC32348@pengutronix.de> (raw)
In-Reply-To: <b9f250fee8e5300e859b2afc234868ba7632f619.1271864861.git.amit.kucheria@canonical.com>
On Wed, Apr 21, 2010 at 09:37:31PM +0300, Amit Kucheria wrote:
> clk->usecount can be used by platform code to check if a clock is active or
> not.
>
> Signed-off-by: Amit Kucheria <amit.kucheria@canonical.com>
> ---
> arch/arm/plat-mxc/clock.c | 37 ++++++++++++++++++++++++-------------
> 1 files changed, 24 insertions(+), 13 deletions(-)
>
> diff --git a/arch/arm/plat-mxc/clock.c b/arch/arm/plat-mxc/clock.c
> index 323ff8c..c791f38 100644
> --- a/arch/arm/plat-mxc/clock.c
> +++ b/arch/arm/plat-mxc/clock.c
> @@ -50,15 +50,15 @@ static DEFINE_MUTEX(clocks_mutex);
>
> static void __clk_disable(struct clk *clk)
> {
> - if (clk == NULL || IS_ERR(clk))
> + if (clk == NULL || IS_ERR(clk) || !clk->usecount)
> return;
>
> - __clk_disable(clk->parent);
> - __clk_disable(clk->secondary);
> -
> - WARN_ON(!clk->usecount);
> - if (!(--clk->usecount) && clk->disable)
> - clk->disable(clk);
> + if (!(--clk->usecount)) {
> + if (clk->disable)
> + clk->disable(clk);
> + __clk_disable(clk->parent);
> + __clk_disable(clk->secondary);
> + }
> }
This removes the WARN_ON if the clock is already off. Is this intended?
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2010-04-22 14:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-21 18:37 [PATCH] arm: mxc: utilise usecount field in clock operations Amit Kucheria
2010-04-22 11:47 ` Baruch Siach
2010-04-22 11:56 ` Sascha Hauer
2010-04-22 13:01 ` Amit Kucheria
2010-04-22 14:37 ` Uwe Kleine-König [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-12-03 23:02 Amit Kucheria
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100422143744.GC32348@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).