Thread (12 messages) flat view 12 messages, 4 authors, 4h ago

Re: [PATCH v3 0/4] dmaengine: rename dma_chan::dev to dma_chan::chan_dev for clarity

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2026-09-05 08:00:52
Also in: dmaengine, imx, linux-arm-kernel, linux-sunxi, linux-tegra, linux-trace-kernel, lkml

On Fri, Sep 04, 2026 at 05:49:42PM -0400, Frank.Li@oss.nxp.com wrote:
The current dma_chan structure contains both "device" and "dev". So

    chan->device->dev refers to the DMA engine device.
    chan->dev->device refers to the per-channel device instance.

Their similar naming makes the distinction unclear and increases reader
confusion.

Add union dma_chan::chan_dev to make its purpose explicit and clearly
identify it as the per-channel device. After all user switch to chan_dev,
union and dma_chan::dev will be removed.

Update the kernel-doc accordingly. Besides its sysfs usage, the per-channel
device is also used by some DMA engine drivers for IOMMU mapping and
therefore deserves a more accurate description.

1st patch add help vchan_chan_name()
2nd patch use existing helper dma_chan_name() to reduce rename difference.
3rd patch add (dmaengine|vchan)_chan_dev() helper
4th patch add union chan_dev for dma_chan::dev for clarity

Need following patch to clean other dma engineer driver, which is not
in drivers/dma

After complete all rename work, dma_chan::dev can be removed.
Nice work!
I have one comment against patch 4/4, after addressing that feel free to add
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
to the entire series.

-- 
With Best Regards,
Andy Shevchenko

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help