summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonard Crestez <leonard.crestez@nxp.com>2019-01-31 14:59:50 -0600
committerBjorn Helgaas <bhelgaas@google.com>2019-01-31 14:59:50 -0600
commita6093ad7fc4962099d2d723bcca72f8175b58c82 (patch)
tree376959921140c9578622b5ecdcb9b33069e5d7d1
parentd2fd6e81912a665993b24dcdc1c1384a42a54f7e (diff)
downloadlwn-a6093ad7fc4962099d2d723bcca72f8175b58c82.tar.gz
lwn-a6093ad7fc4962099d2d723bcca72f8175b58c82.zip
PCI: imx: Fix probe failure without power domain
On chips without a separate power domain for PCI (such as 6q/6qp) the imx6_pcie_attach_pd() function incorrectly returns an error. Fix by returning 0 if dev_pm_domain_attach_by_name() does not find anything. Fixes: 3f7cceeab895 ("PCI: imx: Add multi-pd support") Reported-by: Lukas F.Hartmann <lukas@mntmn.com> Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> [lorenzo.pieralisi@arm.com: updated commit log] Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
-rw-r--r--drivers/pci/controller/dwc/pci-imx6.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 52e47dac028f..ac5f6ae0b254 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -310,6 +310,9 @@ static int imx6_pcie_attach_pd(struct device *dev)
imx6_pcie->pd_pcie = dev_pm_domain_attach_by_name(dev, "pcie");
if (IS_ERR(imx6_pcie->pd_pcie))
return PTR_ERR(imx6_pcie->pd_pcie);
+ /* Do nothing when power domain missing */
+ if (!imx6_pcie->pd_pcie)
+ return 0;
link = device_link_add(dev, imx6_pcie->pd_pcie,
DL_FLAG_STATELESS |
DL_FLAG_PM_RUNTIME |