[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130910100939.GW29403@sirena.org.uk>
Date: Tue, 10 Sep 2013 11:09:39 +0100
From: Mark Brown <broonie@...nel.org>
To: Stephen Warren <swarren@...dotorg.org>
Cc: Guenter Roeck <linux@...ck-us.net>, Wei Ni <wni@...dia.com>,
"khali@...ux-fr.org" <khali@...ux-fr.org>,
"lm-sensors@...sensors.org" <lm-sensors@...sensors.org>,
"linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 1/2] hwmon: (lm90) Add power control
On Mon, Sep 09, 2013 at 10:13:56PM -0600, Stephen Warren wrote:
> On 09/09/2013 09:53 PM, Guenter Roeck wrote:
> > Earlier comments suggest that this is not the intended use case for
> > regulator_get_optional().
That's right.
> Isn't the issue only whether the optional aspect of the regulator is
> implemented by:
> a) regulator_get_optional() returning failure, then the driver having to
> check for that and either using or not-using the regulator.
> b) regulator_get_optional() returning a dummy regulator automatically
> when none is specified in DT or the regulator lookup table, and hence
> the driver can always call regulator_enable/disable on the returned value.
No. There are a couple of issues here. One is that we don't want to
litter all drivers with conditional code to check if they actually got
the regulator and so on, that's just pointless make work on the part of
consumers. The other is that just ignoring errors is generally terrible
practice which we don't want to encourage - ignoring the specific case
where nothing is provided and the system has control of that is one
thing but just ignoring any error is another.
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists