[2/3] PCI: qcom: Don't unroll init if init fails

Message ID 20170716064153.3346-1-bjorn.andersson@linaro.org
State Accepted
Commit 89539f03061fc8aee120ea4a64d31da57d0045f2
Headers show
Series
  • Untitled series #2880
Related show

Commit Message

Bjorn Andersson July 16, 2017, 6:41 a.m.
When the init op fails it will restore the state of the resources, so we
should not disable them one more time when this happens.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>

---
 drivers/pci/dwc/pcie-qcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.12.0

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Bjorn Helgaas Aug. 2, 2017, 9:39 p.m. | #1
On Sat, Jul 15, 2017 at 11:41:53PM -0700, Bjorn Andersson wrote:
> When the init op fails it will restore the state of the resources, so we

> should not disable them one more time when this happens.

> 

> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


Stanimir, any opinion on this and the following patch?

> ---

>  drivers/pci/dwc/pcie-qcom.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c

> index d15657dc3990..7b703741a3fd 100644

> --- a/drivers/pci/dwc/pcie-qcom.c

> +++ b/drivers/pci/dwc/pcie-qcom.c

> @@ -901,7 +901,7 @@ static int qcom_pcie_host_init(struct pcie_port *pp)

>  

>  	ret = pcie->ops->init(pcie);

>  	if (ret)

> -		goto err_deinit;

> +		return ret;

>  

>  	ret = phy_power_on(pcie->phy);

>  	if (ret)

> -- 

> 2.12.0

> 

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c
index d15657dc3990..7b703741a3fd 100644
--- a/drivers/pci/dwc/pcie-qcom.c
+++ b/drivers/pci/dwc/pcie-qcom.c
@@ -901,7 +901,7 @@  static int qcom_pcie_host_init(struct pcie_port *pp)
 
 	ret = pcie->ops->init(pcie);
 	if (ret)
-		goto err_deinit;
+		return ret;
 
 	ret = phy_power_on(pcie->phy);
 	if (ret)