]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: armada8x: Propagate errors for optional PHYs
authorThierry Reding <treding@nvidia.com>
Thu, 29 Aug 2019 10:53:17 +0000 (12:53 +0200)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Wed, 4 Sep 2019 14:42:38 +0000 (15:42 +0100)
commitdceefa8ad7f88d3977718070c8bad2848fd55221
tree148da26bc2f9d4d44338b5b63e0abe79f97e4a6b
parent9978532f4ed3818ae8b8901039a065b1b5959c6a
PCI: armada8x: Propagate errors for optional PHYs

devm_of_phy_get_by_index() 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 devres structures. Propagating only
-EPROBE_DEFER is problematic because it results in these legitimately
fatal errors being treated as "PHY not specified in DT".

What we really want is to ignore the optional PHYs only if they have not
been specified in DT. devm_of_phy_get_by_index() 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: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
drivers/pci/controller/dwc/pcie-armada8k.c