linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: dd diasemi <dd.diasemi@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: drivers/regulator/core.c: Fixes mapping inside regulator_mode_to_status() and makes it returning -EINVAL on invalid input.
Date: Tue, 10 Jan 2012 17:14:14 +0000	[thread overview]
Message-ID: <20120110171412.GA7164@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <CAEqHmAtrUNKTxt3Q8x7=nZNp09ajhyYQn3DmAKd3OUib9hLBUQ@mail.gmail.com>

On Tue, Jan 10, 2012 at 05:09:40PM +0000, dd diasemi wrote:
> On Tue, Jan 10, 2012 at 12:14 AM, Mark Brown

> The behaviour is exactly the same in both cases, because
> REGULATOR_STATUS_OFF == 0.

That's not really the intended behaviour...

> From linux/regulator/driver.h:
> enum regulator_status {
>        REGULATOR_STATUS_OFF,

...if it were intended we'd explicitly set the value here to be zero
here.  The intention is to return an "I don't know" value rather than an
error.

> And to set things up, should regulator_get_status() return negative
> error code or REGULATOR_STATUS_OFF (0) on communication failure?

It should return an error when the I/O fails.

      reply	other threads:[~2012-01-10 17:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-09 12:12 drivers/regulator/core.c: Fixes mapping inside regulator_mode_to_status() and makes it returning -EINVAL on invalid input Krystian Garbaciak
2012-01-09 16:14 ` Mark Brown
2012-01-09 19:20   ` dd diasemi
2012-01-09 20:07     ` Mark Brown
2012-01-10  0:11       ` dd diasemi
2012-01-10  0:14         ` Mark Brown
2012-01-10 17:09           ` dd diasemi
2012-01-10 17:14             ` Mark Brown [this message]

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=20120110171412.GA7164@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=dd.diasemi@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;
as well as URLs for NNTP newsgroup(s).