History

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.

Serge Semin committed 3 years ago

Commit 53c0e2f1 parent 71196854 files · +3 −4Browse files

Unified · Split

4 files
  1. drivers/dma/dw-edma/dw-edma-core.c +2 −1
  2. drivers/dma/dw-edma/dw-edma-core.h +1 −1
  3. drivers/dma/dw-edma/dw-edma-pcie.c +0 −1
  4. include/linux/dma/edma.h +0 −1
drivers/dma/dw-edma/dw-edma-core.c+2−1
@@ -973,7 +973,8 @@ int dw_edma_probe(struct dw_edma_chip *chip) · 972 unmodified lines
973973 if (!dw->chan)
974974 return -ENOMEM;
975975
976− snprintf(dw->name, sizeof(dw->name), "dw-edma-core:%d", chip->id);
976+ snprintf(dw->name, sizeof(dw->name), "dw-edma-core:%s",
977+ dev_name(chip->dev));
977978
978979 /* Disable eDMA, only to establish the ideal initial conditions */
979980 dw_edma_v0_core_off(dw);
drivers/dma/dw-edma/dw-edma-core.h+1−1
@@ -96,7 +96,7 @@ struct dw_edma_irq { · 95 unmodified lines
9696 };
9797
9898 struct dw_edma {
99− char name[20];
99+ char name[32];
100100
101101 struct dma_device dma;
102102
drivers/dma/dw-edma/dw-edma-pcie.c+0−1
@@ -222,7 +222,6 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev, · 221 unmodified lines
222222
223223 /* Data structure initialization */
224224 chip->dev = dev;
225− chip->id = pdev->devfn;
226225
227226 chip->mf = vsec_data.mf;
228227 chip->nr_irqs = nr_irqs;
include/linux/dma/edma.h+0−1
@@ -76,7 +76,6 @@ enum dw_edma_chip_flags { · 75 unmodified lines
7676 */
7777 struct dw_edma_chip {
7878 struct device *dev;
79− int id;
8079 int nr_irqs;
8180 const struct dw_edma_core_ops *ops;
8281 u32 flags;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t