Re: [PATCH 1/1] iio: use dmaengine_get_dma_device() instead of chan->device->dev
From: Jonathan Cameron
Date: Sun Sep 20 2026 - 19:26:16 EST
On Fri, 18 Sep 2026 09:47:24 +0300
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:
> On Thu, Sep 17, 2026 at 04:36:26PM -0400, Frank.Li@xxxxxxxxxxx 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.
Agreed that would be ideal but I don't care enough for a v2!
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
Applied to the testing branch of iio.git (material for next merge window)
That will turn up in linux-next once tests are done and I remember to push.
Thanks,
Jonathan
>