summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Zhu <hongxing.zhu@nxp.com>2017-08-15 17:18:17 +0800
committerRichard Zhu <hongxing.zhu@nxp.com>2017-08-30 17:00:20 +0800
commitdec937f8935c8a7cc6ec77e497e47774d610f93e (patch)
treee00546217b79b80d388c828ed9ff89e978308cf2
parent66c70280da74eecbd8924ba7902b8614b49bf14f (diff)
MLK-16176-2 PCI: imx: get the bus clock regulator correctly
In order to make sure that get the regulator correctly. Check the return value of devm_regulator_get(). Return value directly if it is '-EPROBE_DEFER' Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com> (cherry picked from commit 25df25ae44f4d9799c49476516a955b66d5ea9dc)
-rw-r--r--drivers/pci/host/pci-imx6.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
index a9e0a32054b5..1fb3ec9ecf71 100644
--- a/drivers/pci/host/pci-imx6.c
+++ b/drivers/pci/host/pci-imx6.c
@@ -1302,11 +1302,16 @@ static int imx6_pcie_probe(struct platform_device *pdev)
return PTR_ERR(imx6_pcie->pcie_inbound_axi);
}
}
-
- imx6_pcie->pcie_bus_regulator = devm_regulator_get(pp->dev,
- "pcie-bus");
- if (IS_ERR(imx6_pcie->pcie_bus_regulator))
+ if (imx6_pcie->variant == IMX6QP) {
+ imx6_pcie->pcie_bus_regulator = devm_regulator_get(pp->dev,
+ "pcie-bus");
+ if (PTR_ERR(imx6_pcie->pcie_bus_regulator) == -EPROBE_DEFER)
+ return -EPROBE_DEFER;
+ if (IS_ERR(imx6_pcie->pcie_bus_regulator))
+ imx6_pcie->pcie_bus_regulator = NULL;
+ } else {
imx6_pcie->pcie_bus_regulator = NULL;
+ }
/* Grab GPR config register range */
if (imx6_pcie->variant == IMX7D) {