]> git.itanic.dy.fi Git - linux-stable/commit
PCI: histb: Propagate errors for optional regulators
authorThierry Reding <treding@nvidia.com>
Thu, 29 Aug 2019 10:53:18 +0000 (12:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Oct 2019 16:57:13 +0000 (18:57 +0200)
commit403d6c9284f12ad3ef556201a854e005523c22dc
tree4d5488329f3b42b1bcb51d7f45f421946b68bc1d
parentac9c0e2ecc491ec84eb4413d94ae8901ef08d3ec
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>
drivers/pci/controller/dwc/pcie-histb.c