public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Jean Delvare <khali@linux-fr.org>
Cc: Jerome Oufella <jerome.oufella@savoirfairelinux.com>,
	lm-sensors <lm-sensors@lm-sensors.org>,
	linux-kernel@vger.kernel.org, Liam Girdwood <lrg@slimlogic.co.uk>
Subject: Re: [lm-sensors] regulator: regulator_get behaviour without CONFIG_REGULATOR set
Date: Mon, 5 Apr 2010 14:23:47 +0100	[thread overview]
Message-ID: <20100405132347.GA6580@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <20100403173745.2bf17ee6@hyperion.delvare>

On Sat, Apr 03, 2010 at 05:37:45PM +0200, Jean Delvare wrote:
> On Fri, 2 Apr 2010 21:45:03 +0100, Mark Brown wrote:

> > In this case you don't need the if (voltage) check - the code that uses
> > supply_uV is going to have to cope with it being set to 0 if the driver
> > doesn't just give up, and the enable wants to happen anyway (perhaps
> > we've got a switchable supply we can't read the voltage of).  It should
> > never make any odds if the notifier never gets called since the supply
> > could be invariant.

> We still need to check if (voltage) to not overwrite the previous value
> of data->supply_uV with 0. We will probably do that as an immediate fix
> to the sht15 driver. But yes, the rest doesn't need a condition.

I was assuming that there wasn't a previous value since this was in
probe(), sorry.

> Still, I'd prefer if drivers were just able to check for data->reg ==
> NULL and skip the whole thing. Would you apply the following patch?

> From: Jean Delvare <khali@linux-fr.org>
> Subject: regulator: Let drivers know when they use the stub API

> Have the stub variant of regulator_get() return NULL, so that drivers
> can (but still don't have to) handle this case specifically.

I guess I'll ack it but I'd be suspicous of driver code which actually
makes use of this - there is actual hardware which has the same features
as the regulator that gets stubbed in and ought to be handled.  On the
other hand, perhaps someone will come up with a good use for it.

It also seems a bit odd to return a traditional error value in a success
case but it doesn't actually make much difference.

  reply	other threads:[~2010-04-05 13:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2122967437.461270223106350.JavaMail.root@mail.savoirfairelinux.com>
2010-04-02 15:47 ` regulator: regulator_get behaviour without CONFIG_REGULATOR set Jerome Oufella
2010-04-02 16:00   ` Mark Brown
2010-04-02 16:44     ` [lm-sensors] " Jean Delvare
2010-04-02 18:51       ` Mark Brown
2010-04-02 19:30         ` Jean Delvare
2010-04-02 20:45           ` Mark Brown
2010-04-03 15:37             ` Jean Delvare
2010-04-05 13:23               ` Mark Brown [this message]
2010-04-06 12:04                 ` Jonathan Cameron
2010-04-06 15:27                 ` Liam Girdwood
2010-04-06 16:25                   ` Jonathan Cameron
2010-04-06 18:19                     ` Mark Brown
2010-04-07  9:50                       ` Liam Girdwood
2010-04-07 11:24                       ` Jonathan Cameron
2010-04-07 11:57                         ` 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=20100405132347.GA6580@rakim.wolfsonmicro.main \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=jerome.oufella@savoirfairelinux.com \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=lrg@slimlogic.co.uk \
    /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