All of lore.kernel.org
 help / color / mirror / Atom feed
From: Magnus Damm <magnus.damm@gmail.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH 1/2] ARM: mach-shmobile: clock-sh7372: Add FSIDIV clock support
Date: Mon, 04 Oct 2010 03:35:54 +0000	[thread overview]
Message-ID: <AANLkTi=wMbexitHZqSBOL1ump1muFv-kWVxw1OdRmvh8@mail.gmail.com> (raw)
In-Reply-To: <w3pzkuyihfm.wl%kuninori.morimoto.gx@renesas.com>

On Sat, Oct 2, 2010 at 1:21 AM, Guennadi Liakhovetski
<g.liakhovetski@gmx.de> wrote:
> On Fri, 1 Oct 2010, Kuninori Morimoto wrote:
>
>>
>> This patch add late_main_clks clock array,
>> because these clock needs div6 clocks for use
>>
>> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>> ---
>>  arch/arm/mach-shmobile/clock-sh7372.c        |  132 ++++++++++++++++++++++++++
>>  arch/arm/mach-shmobile/include/mach/sh7372.h |    2 +
>>  2 files changed, 134 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
>> index 8b9f50a..6f8eabe 100644
>> --- a/arch/arm/mach-shmobile/clock-sh7372.c
>> +++ b/arch/arm/mach-shmobile/clock-sh7372.c
>> @@ -50,6 +50,9 @@
>>  #define SMSTPCR3     0xe615013c
>>  #define SMSTPCR4     0xe6150140
>>
>> +#define FSIDIVA              0xFE1F8000
>> +#define FSIDIVB              0xFE1F8008
>> +
>>  /* Platforms must set frequency on their DV_CLKI pin */
>>  struct clk sh7372_dv_clki_clk = {
>>  };
>> @@ -417,6 +420,132 @@ static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = {
>>                                     fsibckcr_parent, ARRAY_SIZE(fsibckcr_parent), 6, 2),
>>  };
>>
>> +/* FSI DIV */
>> +
>> +static void fsidiv_init(struct clk *clk)
>> +{
>> +     clk->enable_reg = ioremap_nocache((unsigned long)clk->enable_reg, 8);
>
> What happens, if ioremap() fails? On the whole, for some reason I don't
> really like this

Perhaps ->init should have a return value?

But I recall Paul disliking that idea?

> void x_init(struct foo *x)
> {
>        x->reg = ioremap(x->reg, N);
> }
>
> approach very much... But maybe it's just me. Why not just add the ioremap
> to this loop
>
>> @@ -582,6 +711,9 @@ void __init sh7372_clock_init(void)
>>       if (!ret)
>>               ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
>>
>> +     for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++)
>> +             ret = clk_register(late_main_clks[k]);
>> +
>>       clkdev_add_table(lookups, ARRAY_SIZE(lookups));
>>
>>       if (!ret)
>
> and only register the respective clock, if it succeeds?

If so then we need to move out the per-clock type init code from all
the clock callbacks to the common per-cpu init routine. I'd rather see
the per-clock type code kept together.

/ magnus

  parent reply	other threads:[~2010-10-04  3:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-01  5:57 [PATCH 1/2] ARM: mach-shmobile: clock-sh7372: Add FSIDIV clock support Kuninori Morimoto
2010-10-01 16:21 ` [PATCH 1/2] ARM: mach-shmobile: clock-sh7372: Add FSIDIV clock Guennadi Liakhovetski
2010-10-04  3:35 ` Magnus Damm [this message]
2010-10-13 14:21 ` [PATCH 1/2] ARM: mach-shmobile: clock-sh7372: Add FSIDIV clock support Paul Mundt
2010-10-14  8:50 ` [PATCH 1/2] ARM: mach-shmobile: clock-sh7372: Add FSIDIV clock Kuninori Morimoto
2010-10-14  9:57 ` [PATCH 1/2] ARM: mach-shmobile: clock-sh7372: Add FSIDIV clock support Paul Mundt
2010-10-14 10:20 ` [PATCH 1/2] ARM: mach-shmobile: clock-sh7372: Add FSIDIV clock Kuninori Morimoto
2012-04-23  7:03 ` [PATCH 1/2] ARM: mach-shmobile: clock-sh73a0: add FSI clock Kuninori Morimoto
2012-05-22  2:34 ` Kuninori Morimoto

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='AANLkTi=wMbexitHZqSBOL1ump1muFv-kWVxw1OdRmvh8@mail.gmail.com' \
    --to=magnus.damm@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.