From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] sh: clkfw: Moved the .init callback in the clk_regsiter
Date: Tue, 12 May 2009 21:42:29 +0000 [thread overview]
Message-ID: <20090512214229.GF479@game.jcrosoft.org> (raw)
In-Reply-To: <1242050283-7986-1-git-send-email-francesco.virlinzi@st.com>
> - __clk_init(clk);
> -
> __clk_enable(clk->parent);
>
> if (clk->ops && clk->ops->enable)
> @@ -175,16 +155,19 @@ EXPORT_SYMBOL_GPL(clk_disable);
>
> int clk_register(struct clk *clk)
> {
> +
> + if (clk->ops && clk->ops->init)
> + if (clk->ops->init(clk) < 0)
> + return -EPERM;
why not allow the clock to return a specifc errno?
> +
> mutex_lock(&clock_list_sem);
>
> list_add(&clk->node, &clock_list);
> clk->usecount = 0;
> - clk->flags |= CLK_NEEDS_INIT;
>
> mutex_unlock(&clock_list_sem);
>
> if (clk->flags & CLK_ALWAYS_ENABLED) {
> - __clk_init(clk);
> pr_debug( "Clock '%s' is ALWAYS_ENABLED\n", clk->name);
> if (clk->ops && clk->ops->enable)
> clk->ops->enable(clk);
> diff --git a/arch/sh/kernel/cpu/sh2/clock-sh7619.c b/arch/sh/kernel/cpu/sh2/clock-sh7619.c
> index d2c1579..5549534 100644
> --- a/arch/sh/kernel/cpu/sh2/clock-sh7619.c
> +++ b/arch/sh/kernel/cpu/sh2/clock-sh7619.c
> @@ -29,9 +29,10 @@ static const int pfc_divisors[] = {1,2,0,4};
> #error "Illigal Clock Mode!"
> #endif
>
> -static void master_clk_init(struct clk *clk)
> +static int master_clk_init(struct clk *clk)
> {
> clk->rate *= PLL2 * pll1rate[(ctrl_inw(FREQCR) >> 8) & 7];
> + return 0;
> }
>
> static struct clk_ops sh7619_master_clk_ops = {
<snip>
> diff --git a/arch/sh/kernel/cpu/sh4/clock-sh4-202.c b/arch/sh/kernel/cpu/sh4/clock-sh4-202.c
> index a334294..2c46a51 100644
> --- a/arch/sh/kernel/cpu/sh4/clock-sh4-202.c
> +++ b/arch/sh/kernel/cpu/sh4/clock-sh4-202.c
> @@ -66,7 +66,7 @@ static struct clk sh4202_femi_clk = {
> .ops = &sh4202_femi_clk_ops,
> };
>
> -static void shoc_clk_init(struct clk *clk)
> +static int shoc_clk_init(struct clk *clk)
> {
> int i;
>
> @@ -88,6 +88,7 @@ static void shoc_clk_init(struct clk *clk)
> }
>
> WARN_ON(i = ARRAY_SIZE(frqcr3_divisors)); /* Undefined clock */
> + return 0;
return 0? if the clock in undefined it will best to report it, is not?
> }
>
> static void shoc_clk_recalc(struct clk *clk)
> diff --git a/arch/sh/kernel/cpu/sh4/clock-sh4.c b/arch/sh/kernel/cpu/sh4/clock-sh4.c
> index dca9f87..70794ac 100644
> --- a/arch/sh/kernel/cpu/sh4/clock-sh4.c
> +++ b/arch/sh/kernel/cpu/sh4/clock-sh4.c
> @@ -26,9 +26,10 @@ static int ifc_divisors[] = { 1, 2, 3, 4, 6, 8, 1, 1 };
> #define bfc_divisors ifc_divisors /* Same */
> static int pfc_divisors[] = { 2, 3, 4, 6, 8, 2, 2, 2 };
>
Best Regards,
J.
next prev parent reply other threads:[~2009-05-12 21:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-11 13:58 [PATCH] sh: clkfw: Moved the .init callback in the clk_regsiter Francesco VIRLINZI
2009-05-12 21:42 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2009-05-13 6:08 ` [PATCH] sh: clkfw: Moved the .init callback in the clk_register function [v3] Francesco VIRLINZI
2009-05-13 7:32 ` [PATCH] sh: clkfw: Moved the .init callback in the clk_regsiter Francesco VIRLINZI
2009-05-13 10:51 ` [PATCH] sh: clkfw: Moved the .init callback in the clk_register Magnus Damm
2009-05-13 12:27 ` [PATCH] sh: clkfw: Moved the .init callback in the clk_register function [v4] Francesco VIRLINZI
2009-05-13 14:12 ` [PATCH] sh: clkfw: Moved the .init callback in the Jean-Christophe PLAGNIOL-VILLARD
2009-05-13 14:20 ` [PATCH] sh: clkfw: Moved the .init callback in the clk_register Francesco VIRLINZI
2009-05-14 3:52 ` [PATCH] sh: clkfw: Moved the .init callback in the clk_register function [v4] Paul Mundt
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=20090512214229.GF479@game.jcrosoft.org \
--to=plagnioj@jcrosoft.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