From: linus.walleij@stericsson.com (Linus Walleij)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM amba: optional PrimeCell core voltage switch
Date: Wed, 3 Nov 2010 15:14:47 +0100 [thread overview]
Message-ID: <4CD16E57.5070708@stericsson.com> (raw)
In-Reply-To: <AANLkTimPH7KHZrTtdGSSno7zz7tH56KCbYjoJibK=WwL@mail.gmail.com>
Sundar wrote:
> On Wed, Nov 3, 2010 at 3:39 PM, Linus Walleij
> <linus.walleij@stericsson.com> wrote:
>> +static int amba_get_enable_vcore(struct amba_device *pcdev)
>> +{
>> + struct regulator *vcore = regulator_get(&pcdev->dev, "vcore");
>> + int ret;
>> +
>> + pcdev->vcore = vcore;
>> +
>> + if (IS_ERR(vcore)) {
>> + /* It is OK not to supply a vcore regulator */
>> + if (PTR_ERR(vcore) == -ENODEV)
>> + return 0;
>> + return PTR_ERR(vcore);
>> + }
>
> If i am right, you corrupt the pcdev->vcore even in an error case.
Yeah that's the intention. It's modeled on the clock code that
does the same thing, then in the disable_put function and
helper macros in bus.h we account for the error case.
I would have set it to NULL instead, but I wanted it to be as
close to the clock code as possible.
Thanks!
Linus Walleij
next prev parent reply other threads:[~2010-11-03 14:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-03 10:09 [PATCH] ARM amba: optional PrimeCell core voltage switch Linus Walleij
2010-11-03 14:11 ` Sundar
2010-11-03 14:14 ` Linus Walleij [this message]
2010-11-03 15:05 ` Russell King - ARM Linux
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=4CD16E57.5070708@stericsson.com \
--to=linus.walleij@stericsson.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.