iio: adc: stm32-adc: fix device used to request dma
authorFabrice Gasnier <fabrice.gasnier@st.com>
Thu, 30 Apr 2020 09:28:45 +0000 (11:28 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 3 May 2020 13:15:38 +0000 (14:15 +0100)
commit52cd91c27f3908b88e8b25aed4a4d20660abcc45
tree23b51fd26f20c536f396990b399e0ee68361880c
parentbcfa1e253d2e329e1ebab5c89f3c73f6dd17606c
iio: adc: stm32-adc: fix device used to request dma

DMA channel request should use device struct from platform device struct.
Currently it's using iio device struct. But at this stage when probing,
device struct isn't yet registered (e.g. device_register is done in
iio_device_register). Since commit 71723a96b8b1 ("dmaengine: Create
symlinks between DMA channels and slaves"), a warning message is printed
as the links in sysfs can't be created, due to device isn't yet registered:
- Cannot create DMA slave symlink
- Cannot create DMA dma:rx symlink

Fix this by using device struct from platform device to request dma chan.

Fixes: 2763ea0585c99 ("iio: adc: stm32: add optional dma support")

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/stm32-adc.c