[PATCH 1/2] PCI: dwc: Cleanup dw_pcie_edma_irq_verify()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



dw_pcie_edma_irq_vector() requires either "dma" (if there is a single IRQ
for all DMA channels) or "dmaX" (if there is one IRQ per DMA channel) to
be specified in device tree.

Thus, it does not make any sense for dw_pcie_edma_irq_verify() to have a
looser requirement than dw_pcie_edma_irq_vector(). (Since both functions
will get called during the probe of the eDMA driver. First
dw_pcie_edma_irq_verify(), then dw_pcie_edma_irq_vector().)

Thus, remove this redundant code in dw_pcie_edma_irq_verify(), such that
dw_pcie_edma_irq_verify() and dw_pcie_edma_irq_vector() have the same
requirements.

Signed-off-by: Niklas Cassel <cassel@xxxxxxxxxx>
---
 drivers/pci/controller/dwc/pcie-designware.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
index 89aad5a08928c..c7a2cf5e886f3 100644
--- a/drivers/pci/controller/dwc/pcie-designware.c
+++ b/drivers/pci/controller/dwc/pcie-designware.c
@@ -1045,9 +1045,7 @@ static int dw_pcie_edma_irq_verify(struct dw_pcie *pci)
 	char name[15];
 	int ret;
 
-	if (pci->edma.nr_irqs == 1)
-		return 0;
-	else if (pci->edma.nr_irqs > 1)
+	if (pci->edma.nr_irqs > 1)
 		return pci->edma.nr_irqs != ch_cnt ? -EINVAL : 0;
 
 	ret = platform_get_irq_byname_optional(pdev, "dma");
-- 
2.51.0





[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux