iio: adc: at91-sama5d2_adc: fix DMA conversion crash
authorEugen Hristev <eugen.hristev@microchip.com>
Wed, 23 Sep 2020 12:17:48 +0000 (15:17 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 29 Sep 2020 16:50:35 +0000 (17:50 +0100)
commit1a198794451449113fa86994ed491d6986802c23
treef8b8a9753897319fc54b70f44e32a60a71d5023d
parentb8a533f3c24b3b8f1fdbefc5ada6a7d5733d63e6
iio: adc: at91-sama5d2_adc: fix DMA conversion crash

After the move of the postenable code to preenable, the DMA start was
done before the DMA init, which is not correct.
The DMA is initialized in set_watermark. Because of this, we need to call
the DMA start functions in set_watermark, after the DMA init, instead of
preenable hook, when the DMA is not properly setup yet.

Fixes: f3c034f61775 ("iio: at91-sama5d2_adc: adjust iio_triggered_buffer_{predisable,postenable} positions")
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Link: https://lore.kernel.org/r/20200923121748.49384-1-eugen.hristev@microchip.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/at91-sama5d2_adc.c