[PATCH 1/1] iio: use dmaengine_get_dma_device() instead of chan->device->dev

Andy Shevchenko andriy.shevchenko at intel.com
Thu Sep 17 23:47:24 PDT 2026


On Thu, Sep 17, 2026 at 04:36:26PM -0400, Frank.Li at oss.nxp.com wrote:

> Replace direct dma_chan::device::dev access with the proper
> dmaengine_get_dma_device() accessor in IIO DMA consumers.
> 
> 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.

...

>  drivers/iio/adc/at91-sama5d2_adc.c                 |  9 ++++++---
>  drivers/iio/adc/nxp-sar-adc.c                      |  2 +-
>  drivers/iio/adc/stm32-adc.c                        | 10 ++++++----
>  drivers/iio/adc/stm32-dfsdm-adc.c                  |  4 ++--
>  drivers/iio/adc/ti_am335x_adc.c                    |  4 ++--
>  drivers/iio/buffer/industrialio-buffer-dmaengine.c |  5 +++--

Strictly speaking this is two patches, one per ADC folder and the other against
IIO core. But this one is not a big one, so up to Jonathan.

Reviewed-by: Andy Shevchenko <andriy.shevchenko at intel.com>

-- 
With Best Regards,
Andy Shevchenko





More information about the linux-arm-kernel mailing list