Thread (14 messages) flat view 14 messages, 7 authors, 2016-02-16

Re: [PATCH] PM / OPP: Initialize regulator pointer to an error value

From: Mark Brown <broonie@kernel.org>
Date: 2016-02-16 16:51:52
Also in: lkml

On Tue, Feb 16, 2016 at 04:12:39PM +0100, Arnd Bergmann wrote:
On Tuesday 16 February 2016 13:11:08 Mark Brown wrote:
quoted
No, we always return an error pointer if we fail to get a regulator.
The difference with optional regulators is in how we handle the
situation where we have full constraints and a regulator is not mapped
in, normally we assume there must be one with no software control but we
need to work around buggy bindings as the device would be non-functional
without power.
Sorry, I should not have said "optional" here, which has a specific
meaning in the API. I meant a driver that can work with either
CONFIG_REGULATOR enabled or disabled (which is something slightly
different).
Ah, right!
I guess a driver needing to know whether regulators are built-in
should check 'if (IS_ENABLED(CONFIG_REGULATOR))' rather than
checking the return code for NULL.
Yes, that's the expected interface here if anyone does need to check
although for most users it's expected that the stubs will be sufficient
and they don't need to check at all.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help