Thread (20 messages) 20 messages, 6 authors, 2020-11-09

Re: [PATCH 2/2] PCI: rockchip: Simplify optional regulator handling

From: Mark Brown <broonie@kernel.org>
Date: 2019-11-18 18:39:04
Also in: linux-pci, linux-rockchip

On Mon, Nov 18, 2019 at 06:15:38PM +0000, Lorenzo Pieralisi wrote:
On Mon, Nov 18, 2019 at 08:24:28AM -0600, Bjorn Helgaas wrote:
quoted
I don't know anything about the regulator API, but the fact that NULL
can be a valid regulator is itself a little surprising :)
regulator_get() has always been documented as returning a valid
regulator or an ERR_PTR().
if (rockchip->vpcie3v3 == NULL) is true the driver would currently
panic the kernel AFAICS.
We don't currently use this, it's just something we could do.
Also, by making NULL a valid regulator, it means that regulators
(ie pointers) with default values are valid whether we call
devm_regulator_get* or not. I understand this patch can be dropped
but that per-se does not make this driver code any more robust AFAICS.
That's one reason we've not done this.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help