summaryrefslogtreecommitdiffstats
path: root/drivers/pci/host
diff options
context:
space:
mode:
authorShawn Lin <shawn.lin@rock-chips.com>2016-03-07 05:32:21 +0100
committerBjorn Helgaas <bhelgaas@google.com>2016-03-11 19:21:47 +0100
commit25de15c958e98747c7dada3983474bd4b8ae381b (patch)
treed23aebaee8b22fede7ee157716d6acda59a11136 /drivers/pci/host
parentLinux 4.5-rc1 (diff)
downloadlinux-25de15c958e98747c7dada3983474bd4b8ae381b.tar.xz
linux-25de15c958e98747c7dada3983474bd4b8ae381b.zip
PCI: keystone: Defer probing if devm_phy_get() returns -EPROBE_DEFER
A SerDes PHY is optional, so if devm_phy_get() doesn't find one at all, that's fine. But if devm_phy_get() finds a PHY that doesn't have a driver yet, it returns -EPROBE_DEFER. In that case, defer probing the Keystone driver. We may be able to load it later after a PHY driver is loaded. [bhelgaas: changelog, check for -EPROBE_DEFER first] Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/host')
-rw-r--r--drivers/pci/host/pci-keystone.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/host/pci-keystone.c b/drivers/pci/host/pci-keystone.c
index 0aa81bd3de12..cd7034523f52 100644
--- a/drivers/pci/host/pci-keystone.c
+++ b/drivers/pci/host/pci-keystone.c
@@ -359,6 +359,9 @@ static int __init ks_pcie_probe(struct platform_device *pdev)
/* initialize SerDes Phy if present */
phy = devm_phy_get(dev, "pcie-phy");
+ if (PTR_ERR_OR_ZERO(phy) == -EPROBE_DEFER)
+ return PTR_ERR(phy);
+
if (!IS_ERR_OR_NULL(phy)) {
ret = phy_init(phy);
if (ret < 0)