usb: renesas_usbhs: use dmaengine_get_dma_device() instead of chan->device->dev
Subsystems (2)
PATCH v2 1/1 usb: renesas_usbhs: 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.
---
change in v2
- Update subject
- v1 https://lore.kernel.org/all/[email protected]/
--- drivers/usb/renesas_usbhs/fifo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/renesas_usbhs/fifo.c +1 -1
@@ -810,7 +810,7 @@ static int __usbhsf_dma_map_ctrl(struct usbhs_pkt *pkt, int map)struct usbhs_fifo *fifo =usbhs_pipe_to_fifo (pipe);struct dma_chan *chan =usbhsf_dma_chan_get (fifo, pkt); -return info->dma_map_ctrl (chan->device->dev, pkt, map); +return info->dma_map_ctrl (dmaengine_get_dma_device (chan), pkt, map); } static void usbhsf_dma_complete(void *arg,
Signature · 1 line
2.43.0
[email protected]
AI reviewSashiko has reviewed this patch and found no issues.
Quoted 10 lines
From: Frank Li <[email protected]>
Replace direct
dma_chan::device::devaccess with the properdmaengine_get_dma_device()for consumer API.
chan->device->devis 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.
Quoted 5 lines
This also prepares for making the DMA engine provider data structures private. DMA consumers should not access DMA engine internals directly.
Assisted-by LLMSigned-off-by Frank Li <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1