PCI: rockchip: dw: Add PCIE_DW_ROCKCHIP_RC_DMATEST macro limit for dma test unregister

Change-Id: Id9ba68883db0045f4709f8bd59d52914e66babfe
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
This commit is contained in:
Jon Lin
2025-08-18 09:18:39 +08:00
committed by Tao Huang
parent 63fa128c7f
commit a2dced0829

View File

@@ -573,13 +573,13 @@ static int rk_pcie_init_dma_trx(struct rk_pcie *rk_pcie)
if (!rk_pcie_udma_enabled(rk_pcie))
return 0;
#ifdef PCIE_DW_ROCKCHIP_RC_DMATEST
rk_pcie->dma_obj = pcie_dw_dmatest_register(rk_pcie->pci->dev, true);
if (IS_ERR(rk_pcie->dma_obj)) {
dev_err(rk_pcie->pci->dev, "failed to prepare dmatest\n");
return -EINVAL;
if (IS_ENABLED(CONFIG_PCIE_DW_ROCKCHIP_RC_DMATEST)) {
rk_pcie->dma_obj = pcie_dw_dmatest_register(rk_pcie->pci->dev, true);
if (IS_ERR(rk_pcie->dma_obj)) {
dev_err(rk_pcie->pci->dev, "failed to prepare dmatest\n");
return -EINVAL;
}
}
#endif
if (!rk_pcie->dma_obj)
return 0;
@@ -1802,7 +1802,8 @@ static int rk_pcie_remove(struct platform_device *pdev)
dw_pcie_host_deinit(&rk_pcie->pci->pp);
rk_pcie_writel_apb(rk_pcie, PCIE_CLIENT_INTR_MASK, 0xffffffff);
destroy_workqueue(rk_pcie->hot_rst_wq);
pcie_dw_dmatest_unregister(rk_pcie->dma_obj);
if (IS_ENABLED(CONFIG_PCIE_DW_ROCKCHIP_RC_DMATEST))
pcie_dw_dmatest_unregister(rk_pcie->dma_obj);
rockchip_pcie_debugfs_exit(rk_pcie);
if (rk_pcie->irq_domain) {
int virq, j;