Commit 4d60f6d4 authored by Siddharth Vadapalli's avatar Siddharth Vadapalli Committed by Krzysztof Wilczyński

PCI: dra7xx: Fix error handling when IRQ request fails in probe

Commit d4c7d1a0 ("PCI: dwc: dra7xx: Push request_irq()
call to the bottom of probe") moved the IRQ request for
"dra7xx-pcie-main" towards the end of dra7xx_pcie_probe().

However, the error handling does not take into account the
initialization performed by either dra7xx_add_pcie_port() or
dra7xx_add_pcie_ep(), depending on the mode of operation.

Fix the error handling to address this.

Fixes: d4c7d1a0 ("PCI: dwc: dra7xx: Push request_irq() call to the bottom of probe")
Link: https://lore.kernel.org/linux-pci/20240827122422.985547-3-s-vadapalli@ti.comTested-by: default avatarUdit Kumar <u-kumar1@ti.com>
Signed-off-by: default avatarSiddharth Vadapalli <s-vadapalli@ti.com>
[kwilczynski: commit log]
Signed-off-by: default avatarKrzysztof Wilczyński <kwilczynski@kernel.org>
Reviewed-by: default avatarKevin Hilman <khilman@baylibre.com>
Reviewed-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: stable@vger.kernel.org
parent 03f84b3b
...@@ -854,11 +854,17 @@ static int dra7xx_pcie_probe(struct platform_device *pdev) ...@@ -854,11 +854,17 @@ static int dra7xx_pcie_probe(struct platform_device *pdev)
"dra7xx-pcie-main", dra7xx); "dra7xx-pcie-main", dra7xx);
if (ret) { if (ret) {
dev_err(dev, "failed to request irq\n"); dev_err(dev, "failed to request irq\n");
goto err_gpio; goto err_deinit;
} }
return 0; return 0;
err_deinit:
if (dra7xx->mode == DW_PCIE_RC_TYPE)
dw_pcie_host_deinit(&dra7xx->pci->pp);
else
dw_pcie_ep_deinit(&dra7xx->pci->ep);
err_gpio: err_gpio:
err_get_sync: err_get_sync:
pm_runtime_put(dev); pm_runtime_put(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment