From: Francesco VIRLINZI <francesco.virlinzi@st.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] sh: call clock framework init() callback once
Date: Fri, 08 May 2009 05:34:28 +0000 [thread overview]
Message-ID: <4A03C464.9010502@st.com> (raw)
In-Reply-To: <20090507103139.31790.67489.sendpatchset@rx1.opensource.se>
Hi Magnus.
I saw this patch.
I still think the init callback has to be called during the registration...
And at the and this is what your are doing with this patch...
Regards
Francesco
Magnus Damm ha scritto:
> From: Magnus Damm <damm@igel.co.jp>
>
> Make sure that clk->ops->init() only gets called once in
> the case of CLK_ALWAYS_ENABLED. Without this patch the
> init() callback may be called multiple times.
>
> Signed-off-by: Magnus Damm <damm@igel.co.jp>
> ---
>
> arch/sh/kernel/cpu/clock.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> --- 0001/arch/sh/kernel/cpu/clock.c
> +++ work/arch/sh/kernel/cpu/clock.c 2009-05-07 15:00:52.000000000 +0900
> @@ -99,15 +99,18 @@ static int __clk_enable(struct clk *clk)
> * changes and the clock needs to hunt for the proper set of
> * divisors to use before it can effectively recalc.
> */
> +
> + if (clk->flags & CLK_ALWAYS_ENABLED) {
> + kref_get(&clk->kref);
> + return 0;
> + }
> +
> if (unlikely(atomic_read(&clk->kref.refcount) = 1))
> if (clk->ops && clk->ops->init)
> clk->ops->init(clk);
>
> kref_get(&clk->kref);
>
> - if (clk->flags & CLK_ALWAYS_ENABLED)
> - return 0;
> -
> if (likely(clk->ops && clk->ops->enable))
> clk->ops->enable(clk);
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
prev parent reply other threads:[~2009-05-08 5:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-07 10:31 [PATCH] sh: call clock framework init() callback once Magnus Damm
2009-05-08 5:34 ` Francesco VIRLINZI [this message]
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=4A03C464.9010502@st.com \
--to=francesco.virlinzi@st.com \
--cc=linux-sh@vger.kernel.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