From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/1] regulator: gpio-regulator: fix crash when no states property in dt
Date: Tue, 13 Nov 2012 16:57:35 +0900 [thread overview]
Message-ID: <20121113075733.GN18224@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <CAHrpEqSbydeAHngL-NMfQa1HQUsj0US5u=aK6y-ku0DMOW-KkA@mail.gmail.com>
On Mon, Nov 12, 2012 at 09:56:47AM +0800, Frank Li wrote:
> 2012/11/10 Mark Brown <broonie@opensource.wolfsonmicro.com>:
> > On Fri, Nov 09, 2012 at 04:34:36PM +0800, Frank Li wrote:
> >> /* Fetch states. */
> >> prop = of_find_property(np, "states", NULL);
> >> - proplen = prop->length / sizeof(int);
> >> + proplen = prop ? prop->length / sizeof(int) : 0;
> > Aren't states mandatory for this driver, in which case shouldn't the
> > probe fail here?
> I think No. GPIO-Regulator can be used as just turn on/off power
> domain and not adjust voltage or current. So "states" is option.
> "gpios" was already options.
Are you sure this actually works? I glanced at the code and wasn't
convinced it was taking sufficient care to cope with this possibility.
Normally people use a fixed regulator for a regulator with a simple
on/off switch (which allows the voltage to be specified which this
won't...) so I'd be somewhat surprised if it were tested.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121113/d211d11f/attachment.sig>
next prev parent reply other threads:[~2012-11-13 7:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-09 8:34 [PATCH 1/1] regulator: gpio-regulator: fix crash when no states property in dt Frank Li
2012-11-09 16:56 ` Mark Brown
2012-11-12 1:56 ` Frank Li
2012-11-13 7:57 ` Mark Brown [this message]
2012-11-13 8:12 ` Frank Li
2012-11-13 8:17 ` Mark Brown
2012-11-14 9:36 ` Lee Jones
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=20121113075733.GN18224@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.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.