]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
dmaengine: dw-edma: Replace chip ID number with device name
authorSerge Semin <Sergey.Semin@baikalelectronics.ru>
Fri, 13 Jan 2023 17:14:03 +0000 (20:14 +0300)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 10 Feb 2023 23:15:23 +0000 (17:15 -0600)
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: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Acked-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/dw-edma/dw-edma-core.c
drivers/dma/dw-edma/dw-edma-core.h
drivers/dma/dw-edma/dw-edma-pcie.c
include/linux/dma/edma.h

index 040a88cfe070ec8270bd6152ce35578b461a3563..e3671bfbe186685b0764f4a9bcdfb86f91f097d4 100644 (file)
@@ -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);
index e3ad3e372b554f9e1e30d42369d15e8350214731..0ab2b6dba880478f5c2932d2f3645328fb230a6a 100644 (file)
@@ -96,7 +96,7 @@ struct dw_edma_irq {
 };
 
 struct dw_edma {
-       char                            name[20];
+       char                            name[32];
 
        struct dma_device               dma;
 
index f530bacfd716cdfeb8b86be9281001a0fc28ed2c..3f9dadc73854c529a2645af505c321b730ea6eba 100644 (file)
@@ -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;
index 07a23ecc834f58805a7a93919949365abf81b4c1..96bfd0173f3a2f8a0ef488005ac418679e12752a 100644 (file)
@@ -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;