From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Axel Lin <axel.lin@gmail.com>
Cc: linux-kernel@vger.kernel.org,
Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com>,
"Milo(Woogyom) Kim" <milo.kim@ti.com>,
Richard Purdie <rpurdie@rpsys.net>,
Andrew Morton <akpm@linux-foundation.org>,
Liam Girdwood <lrg@ti.com>
Subject: Re: [PATCH] leds: lm3530: fix handling of already enabled regulators
Date: Mon, 23 Apr 2012 12:09:13 +0100 [thread overview]
Message-ID: <20120423110912.GC8318@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1335107508.6261.3.camel@phoenix>
[-- Attachment #1: Type: text/plain, Size: 747 bytes --]
On Sun, Apr 22, 2012 at 11:11:48PM +0800, Axel Lin wrote:
> drvdata->regulator = NULL;
> goto err_regulator_get;
> }
> + drvdata->enable = regulator_is_enabled(drvdata->regulator);
>
This isn't sufficient for what the driver is doing - it also needs to
enable the regulator. Regulator enables are reference counted (since
the regulator can be shared by many device supplies) so if this driver
doesn't reference the regulator when it's needed then it could get
powered off.
If this regulator is the actual LED then the current default of assuming
the regulator is off on boot isn't ideal either as it means that if the
regulator is enabled on boot then the LED may be left on even though the
driver thinks it's off.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-04-23 11:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-22 15:11 [PATCH] leds: lm3530: fix handling of already enabled regulators Axel Lin
2012-04-23 11:09 ` Mark Brown [this message]
2012-04-24 2:09 ` Axel Lin
2012-04-24 6:27 ` Kim, Milo
2012-04-24 8:48 ` Axel Lin
2012-04-24 10:15 ` Kim, Milo
2012-04-24 12:35 ` Axel Lin
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=20120423110912.GC8318@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=akpm@linux-foundation.org \
--cc=axel.lin@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@ti.com \
--cc=milo.kim@ti.com \
--cc=rpurdie@rpsys.net \
--cc=shreshthakumar.sahu@stericsson.com \
/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