Skip to content

Commit 4d60f6d

Browse files
PCI: dra7xx: Fix error handling when IRQ request fails in probe
Commit d4c7d1a ("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: d4c7d1a ("PCI: dwc: dra7xx: Push request_irq() call to the bottom of probe") Link: https://lore.kernel.org/linux-pci/[email protected] Tested-by: Udit Kumar <[email protected]> Signed-off-by: Siddharth Vadapalli <[email protected]> [kwilczynski: commit log] Signed-off-by: Krzysztof Wilczyński <[email protected]> Reviewed-by: Kevin Hilman <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Cc: [email protected]
1 parent 03f84b3 commit 4d60f6d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/pci/controller/dwc/pci-dra7xx.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,11 +854,17 @@ static int dra7xx_pcie_probe(struct platform_device *pdev)
854854
"dra7xx-pcie-main", dra7xx);
855855
if (ret) {
856856
dev_err(dev, "failed to request irq\n");
857-
goto err_gpio;
857+
goto err_deinit;
858858
}
859859

860860
return 0;
861861

862+
err_deinit:
863+
if (dra7xx->mode == DW_PCIE_RC_TYPE)
864+
dw_pcie_host_deinit(&dra7xx->pci->pp);
865+
else
866+
dw_pcie_ep_deinit(&dra7xx->pci->ep);
867+
862868
err_gpio:
863869
err_get_sync:
864870
pm_runtime_put(dev);

0 commit comments

Comments
 (0)