Commit 53c0e2f9 authored by Serge Semin's avatar Serge Semin Committed by Bjorn Helgaas
Browse files

dmaengine: dw-edma: Replace chip ID number with device name

Using an abstract number as the DW eDMA chip identifier isn't practical
because there can be more than one DW eDMA controller on the platform. Some
may be detected as the PCIe Endpoints, and others may be embedded in DW
PCIe Root Port/Endpoint controllers.  An abstract number in, for instance,
the IRQ handlers list, doesn't give a notion regarding their reference to
the particular DMA controller.

To preserve the code simplicity and support multi-eDMA platforms, use the
parental device name to create the DW eDMA controller name.

Link: https://lore.kernel.org/r/20230113171409.30470-22-Sergey.Semin@baikalelectronics.ru


Tested-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: default avatarSerge Semin <Sergey.Semin@baikalelectronics.ru>
Signed-off-by: default avatarLorenzo Pieralisi <lpieralisi@kernel.org>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Acked-by: default avatarVinod Koul <vkoul@kernel.org>
parent 7119685c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -973,7 +973,8 @@ int dw_edma_probe(struct dw_edma_chip *chip)
	if (!dw->chan)
		return -ENOMEM;

	snprintf(dw->name, sizeof(dw->name), "dw-edma-core:%d", chip->id);
	snprintf(dw->name, sizeof(dw->name), "dw-edma-core:%s",
		 dev_name(chip->dev));

	/* Disable eDMA, only to establish the ideal initial conditions */
	dw_edma_v0_core_off(dw);
+1 −1
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ struct dw_edma_irq {
};

struct dw_edma {
	char				name[20];
	char				name[32];

	struct dma_device		dma;

+0 −1
Original line number Diff line number Diff line
@@ -222,7 +222,6 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev,

	/* Data structure initialization */
	chip->dev = dev;
	chip->id = pdev->devfn;

	chip->mf = vsec_data.mf;
	chip->nr_irqs = nr_irqs;
+0 −1
Original line number Diff line number Diff line
@@ -76,7 +76,6 @@ enum dw_edma_chip_flags {
 */
struct dw_edma_chip {
	struct device		*dev;
	int			id;
	int			nr_irqs;
	const struct dw_edma_core_ops   *ops;
	u32			flags;