From: Mark Brown <broonie@kernel.org>
To: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Cc: Doug Anderson <dianders@chromium.org>,
Liam Girdwood <lgirdwood@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] regulator: Only enable disabled regulators on resume
Date: Sun, 8 Mar 2015 19:38:12 +0000 [thread overview]
Message-ID: <20150308193812.GW28806@sirena.org.uk> (raw)
In-Reply-To: <54F70C5C.4080201@collabora.co.uk>
[-- Attachment #1: Type: text/plain, Size: 1263 bytes --]
On Wed, Mar 04, 2015 at 02:45:00PM +0100, Javier Martinez Canillas wrote:
> The thing is that _regulator_is_enabled() used to return -EINVAL if
> the rdev didn't have an .is_enabled callback but that changed in
> commit 9a7f6a4c6edc8 ("regulator: Assume regulators are enabled if
> they don't report anything") and now returns 1 in that case. But
> _regulator_enable() was not changed and is still checking for -EINVAL
> which seems to me like a left over after the mentioned commit.
You mean _do_enable(), not _enable() here. It's not really a leftover
as the two operations are doing somewhat different things and the
changes are a bit separate, _is_enabled() is reporting the current state
while _do_enable() is making a change so it should fail if it can't do
that.
A better way of writing it in the _do_enable() case is that it possibly
ought to be checking if the regulator is enabled before it does
anything, though for uncached regulator operations that then means an
extra I/O which isn't great. Given that I think rather than ignoring
the missing op it should instead fall back to checking _is_enabled() -
that way if we can read the state but not change it the right thing will
happen. I'll do a patch, probably tomorrow.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2015-03-08 19:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-02 20:40 Javier Martinez Canillas
2015-03-03 17:24 ` Doug Anderson
2015-03-03 19:05 ` Javier Martinez Canillas
2015-03-04 13:45 ` Javier Martinez Canillas
2015-03-08 19:38 ` Mark Brown [this message]
2015-03-09 7:40 ` Javier Martinez Canillas
2015-03-11 10:57 ` Mark Brown
2015-03-11 11:00 ` Javier Martinez Canillas
2015-03-08 19:38 ` Mark Brown
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=20150308193812.GW28806@sirena.org.uk \
--to=broonie@kernel.org \
--cc=dianders@chromium.org \
--cc=javier.martinez@collabora.co.uk \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®