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.