From: Frank Li <[email protected]>

Replace open-coded chan->device->dev with dmaengine_get_dma_device()
and chan->device->dev->of_node with
dmaengine_get_provider_device()->of_node to avoid direct access to
DMA engine internals.

dmaengine_get_dma_device(): for dma map device, may return pre chan device
if dmaengine support per chan iommu mapping.
dmaengine_get_provider_device(): for dmaengine device filter, which have
of_node.

Prepare to make struct dma_device private.

Signed-off-by: Frank Li <[email protected]>
---
 sound/soc/fsl/fsl_asrc_dma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c
index cd3bf6340b650..71f84359df3af 100644
--- a/sound/soc/fsl/fsl_asrc_dma.c
+++ b/sound/soc/fsl/fsl_asrc_dma.c
@@ -261,7 +261,7 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component 
*component,
                pair->dma_data.priority = tmp_data->priority;
                dma_release_channel(tmp_chan);
 
-               of_dma_node = pair->dma_chan[!dir]->device->dev->of_node;
+               of_dma_node = 
dmaengine_get_provider_device(pair->dma_chan[!dir])->of_node;
                pair->dma_chan[dir] =
                        __dma_request_channel(&mask, filter, &pair->dma_data,
                                              of_dma_node);
@@ -526,7 +526,7 @@ static int fsl_asrc_dma_pcm_new(struct snd_soc_component 
*component,
 
        ret = snd_pcm_set_fixed_buffer_all(pcm,
                                           SNDRV_DMA_TYPE_DEV,
-                                          chan->device->dev,
+                                          dmaengine_get_dma_device(chan),
                                           FSL_ASRC_DMABUF_SIZE);
 
        dma_release_channel(chan);

-- 
2.43.0


Reply via email to