diff options
author | Bjorn Andersson <bjorn.andersson@linaro.org> | 2017-07-16 09:39:45 +0300 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2017-08-04 00:14:32 +0300 |
commit | 4a301766f5263dd94c1b95d1b1bbdf338afb1a37 (patch) | |
tree | 9013a6e5a8441611534df7db0c4ecb5fbb80b880 /drivers/pci/dwc/pcie-qcom.c | |
parent | e9be4d78618af2e0d5592d9556cf0bba210cfd1a (diff) | |
download | linux-4a301766f5263dd94c1b95d1b1bbdf338afb1a37.tar.xz |
PCI: dwc: designware: Handle ->host_init() failures
In several dwc-based drivers, ->host_init() can fail, so make sure to
propagate and handle this to avoid continuing operation of a driver or
hardware in an invalid state.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Joao Pinto <jpinto@synopsys.com>
Acked-by: Jingoo Han <jingoohan1@gmail.com>
Diffstat (limited to 'drivers/pci/dwc/pcie-qcom.c')
-rw-r--r-- | drivers/pci/dwc/pcie-qcom.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c index 68c5f2ab5bc8..d15657dc3990 100644 --- a/drivers/pci/dwc/pcie-qcom.c +++ b/drivers/pci/dwc/pcie-qcom.c @@ -891,7 +891,7 @@ static int qcom_pcie_link_up(struct dw_pcie *pci) return !!(val & PCI_EXP_LNKSTA_DLLLA); } -static void qcom_pcie_host_init(struct pcie_port *pp) +static int qcom_pcie_host_init(struct pcie_port *pp) { struct dw_pcie *pci = to_dw_pcie_from_pp(pp); struct qcom_pcie *pcie = to_qcom_pcie(pci); @@ -921,12 +921,14 @@ static void qcom_pcie_host_init(struct pcie_port *pp) if (ret) goto err; - return; + return 0; err: qcom_ep_reset_assert(pcie); phy_power_off(pcie->phy); err_deinit: pcie->ops->deinit(pcie); + + return ret; } static int qcom_pcie_rd_own_conf(struct pcie_port *pp, int where, int size, |