rapidio: use dmaengine_get_dma_device() instead of chan->device->dev
Subsystems (2)
PATCH 1/1 rapidio: use dmaengine_get_dma_device() instead of chan->device->dev
From: Frank Li <[email protected]>
Replace direct dma_chan::device::dev access with the proper dmaengine_get_dma_device() for consumer API.
chan->device->dev is not always the device used for DMA mapping. Some DMA engines support per-channel IOMMU mappings, so different channels may use different DMA devices. dmaengine_get_dma_device() returns the correct device for each channel.
This also prepares for making the DMA engine provider data structures private. DMA consumers should not access DMA engine internals directly.
Assisted-by LLM
Signed-off-by Frank Li <[email protected]>
---
Cc: [email protected]
Cc: [email protected]
--- drivers/rapidio/devices/rio_mport_cdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/rapidio/devices/rio_mport_cdev.c +2 -2
@@ -555,7 +555,7 @@ static void dma_req_free(struct kref *ref) refcount);struct mport_cdev_priv *priv = req->priv; -dma_unmap_sg (req->dmach->device->dev, +dma_unmap_sg (dmaengine_get_dma_device (req->dmach), req->sgt.sgl, req->sgt.nents, req->dir);sg_free_table (&req->sgt);if (req->page_list) {
@@ -916,7 +916,7 @@ rio_dma_transfer(struct file *filp, u32 transfer_mode, xfer->offset, xfer->length); } - nents =dma_map_sg (chan->device->dev, + nents =dma_map_sg (dmaengine_get_dma_device (chan), req->sgt.sgl, req->sgt.nents, dir);if (nents ==0 ) {rmcd_error ("Failed to map SG list" );
Signature · 1 line
2.43.0