diff options
Diffstat (limited to 'drivers/pci/controller/dwc/pci-imx6.c')
| -rw-r--r-- | drivers/pci/controller/dwc/pci-imx6.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 52e47dac028f..80f843030e36 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) | |||
| 310 | imx6_pcie->pd_pcie = dev_pm_domain_attach_by_name(dev, "pcie"); | 310 | imx6_pcie->pd_pcie = dev_pm_domain_attach_by_name(dev, "pcie"); |
| 311 | if (IS_ERR(imx6_pcie->pd_pcie)) | 311 | if (IS_ERR(imx6_pcie->pd_pcie)) |
| 312 | return PTR_ERR(imx6_pcie->pd_pcie); | 312 | return PTR_ERR(imx6_pcie->pd_pcie); |
| 313 | /* Do nothing when power domain missing */ | ||
| 314 | if (!imx6_pcie->pd_pcie) | ||
| 315 | return 0; | ||
| 313 | link = device_link_add(dev, imx6_pcie->pd_pcie, | 316 | link = device_link_add(dev, imx6_pcie->pd_pcie, |
| 314 | DL_FLAG_STATELESS | | 317 | DL_FLAG_STATELESS | |
| 315 | DL_FLAG_PM_RUNTIME | | 318 | DL_FLAG_PM_RUNTIME | |
| @@ -323,13 +326,13 @@ static int imx6_pcie_attach_pd(struct device *dev) | |||
| 323 | if (IS_ERR(imx6_pcie->pd_pcie_phy)) | 326 | if (IS_ERR(imx6_pcie->pd_pcie_phy)) |
| 324 | return PTR_ERR(imx6_pcie->pd_pcie_phy); | 327 | return PTR_ERR(imx6_pcie->pd_pcie_phy); |
| 325 | 328 | ||
| 326 | device_link_add(dev, imx6_pcie->pd_pcie_phy, | 329 | link = device_link_add(dev, imx6_pcie->pd_pcie_phy, |
| 327 | DL_FLAG_STATELESS | | 330 | DL_FLAG_STATELESS | |
| 328 | DL_FLAG_PM_RUNTIME | | 331 | DL_FLAG_PM_RUNTIME | |
| 329 | DL_FLAG_RPM_ACTIVE); | 332 | DL_FLAG_RPM_ACTIVE); |
| 330 | if (IS_ERR(link)) { | 333 | if (!link) { |
| 331 | dev_err(dev, "Failed to add device_link to pcie_phy pd: %ld\n", PTR_ERR(link)); | 334 | dev_err(dev, "Failed to add device_link to pcie_phy pd.\n"); |
| 332 | return PTR_ERR(link); | 335 | return -EINVAL; |
| 333 | } | 336 | } |
| 334 | 337 | ||
| 335 | return 0; | 338 | return 0; |
