Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH 1/2] PCI: dwc: Cleanup dw_pcie_edma_irq_verify()
@ 2025-09-08 16:59 Niklas Cassel
  2025-09-08 16:59 ` [PATCH 2/2] PCI: qcom-ep: Remove redundant edma.nr_irqs initialization Niklas Cassel
  2025-09-11 17:51 ` [PATCH 1/2] PCI: dwc: Cleanup dw_pcie_edma_irq_verify() Manivannan Sadhasivam
  0 siblings, 2 replies; 3+ messages in thread
From: Niklas Cassel @ 2025-09-08 16:59 UTC (permalink / raw)
  To: Jingoo Han, Manivannan Sadhasivam, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas
  Cc: Shin'ichiro Kawasaki, Niklas Cassel, linux-pci

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@kernel.org>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-09-11 17:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-08 16:59 [PATCH 1/2] PCI: dwc: Cleanup dw_pcie_edma_irq_verify() Niklas Cassel
2025-09-08 16:59 ` [PATCH 2/2] PCI: qcom-ep: Remove redundant edma.nr_irqs initialization Niklas Cassel
2025-09-11 17:51 ` [PATCH 1/2] PCI: dwc: Cleanup dw_pcie_edma_irq_verify() Manivannan Sadhasivam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox