diff options
author | Thierry Reding <treding@nvidia.com> | 2019-08-29 12:53:18 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-07 18:59:32 +0200 |
commit | 130642ed27a6623fb34465afb8bc8ccc4c16c56a (patch) | |
tree | 29e2d7bf849d1a0bb12bcb44dd9064a9b101edd9 /lib/sg_split.c | |
parent | dc35055b644fab4349b7deeafe088c1eba0d83f9 (diff) | |
download | linux-stable-130642ed27a6623fb34465afb8bc8ccc4c16c56a.tar.gz linux-stable-130642ed27a6623fb34465afb8bc8ccc4c16c56a.tar.bz2 linux-stable-130642ed27a6623fb34465afb8bc8ccc4c16c56a.zip |
PCI: histb: Propagate errors for optional regulators
[ Upstream commit 8f9e1641ba445437095411d9fda2324121110d5d ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'lib/sg_split.c')
0 files changed, 0 insertions, 0 deletions