All of lore.kernel.org
 help / color / mirror / Atom feed
From: viresh.kumar@st.com (Viresh KUMAR)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2] GPIO PL061: Adding Clk framework support
Date: Tue, 22 Jun 2010 09:30:54 +0530	[thread overview]
Message-ID: <4C203576.2060200@st.com> (raw)
In-Reply-To: <AANLkTim0x5_4re3CWzWDRr1QMq46sQa1SCSyAiymmiUW@mail.gmail.com>

On 6/21/2010 11:04 PM, Linus Walleij wrote:
> 2010/6/21 Rabin Vincent <rabin@rab.in>:
>> On Mon, Jun 21, 2010 at 12:27:43PM +0530, Viresh KUMAR wrote:
>>> +     chip->clk = clk_get(&dev->dev, NULL);
>>> +     if (IS_ERR(chip->clk)) {
>>> +             ret = PTR_ERR(chip->clk);
>>> +             goto iounmap;
>>> +     }
>>
>> Have you verified that all platforms using this driver already have
>> clocks with the appropriate names?   Otherwise this patch will break
>> those platforms.
> 
> The ARM Versatiles and RealViews are always clocked I think,
> so clock support should be optional.
> 
> When I added a clock lookup to the PL08x block recently I used
> a construct like this for an optional clock:
> 
> chip->clk = clk_get(&dev->dev, NULL);
> if (IS_ERR(chip->clk)) {
>        ret = PTR_ERR(chip->clk);
>        if (ret == -ENOENT)
>           /* No block clock in this platform */
>           chip->clk = NULL;
>        else
>           goto iounmap;
> }
> 
> This will work whenever clkdevice is used, since that
> returns -ENOENT for nonexisting entries.
> 
> Then:
> 
> if (chip->clk)
>   clk_enable(chip->clk);
> 

Will modify it, as suggested.

thanks
viresh.

  reply	other threads:[~2010-06-22  4:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-21  6:57 [PATCH V2] GPIO PL061: Adding Clk framework support Viresh KUMAR
2010-06-21 15:41 ` Rabin Vincent
2010-06-21 17:34   ` Linus Walleij
2010-06-22  4:00     ` Viresh KUMAR [this message]
2010-06-21 17:41 ` Baruch Siach
2010-06-22  4:07   ` Viresh KUMAR
  -- strict thread matches above, loose matches on Subject: below --
2010-06-22  4:07 [PATCH v2] " Viresh KUMAR
2010-06-22  4:21 ` Rabin Vincent
2010-06-22  4:42   ` Viresh KUMAR

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=4C203576.2060200@st.com \
    --to=viresh.kumar@st.com \
    --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 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.