]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: histb: Propagate errors for optional regulators
authorThierry Reding <treding@nvidia.com>
Thu, 29 Aug 2019 10:53:18 +0000 (12:53 +0200)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Wed, 4 Sep 2019 14:43:09 +0000 (15:43 +0100)
commit71308b0bf0c6576eece79adf92610cf12d786f69
tree294a543bf301a65bbb40beca1ef5f5c70c9b8976
parentdceefa8ad7f88d3977718070c8bad2848fd55221
PCI: histb: Propagate errors for optional regulators

regulator_get_optional() can fail for a number of reasons besides probe
deferral. It can for example return -ENOMEM if it runs out of memory as
it tries to allocate data structures. Propagating only -EPROBE_DEFER is
problematic because it results in these legitimately fatal errors being
treated as "regulator not specified in DT".

What we really want is to ignore the optional regulators only if they
have not been specified in DT. regulator_get_optional() returns -ENODEV
in this case, so that's the special case that we need to handle. So we
propagate all errors, except -ENODEV, so that real failures will still
cause the driver to fail probe.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Andrew Murray <andrew.murray@arm.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
drivers/pci/controller/dwc/pcie-histb.c