]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.22/iio-ad799x-fix-buffered-capture-for-ad7991-ad7995-ad7999.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.22 / iio-ad799x-fix-buffered-capture-for-ad7991-ad7995-ad7999.patch
CommitLineData
6bd99ffc
GKH
1From 7d3cc21dab5313a02f2f3ca8164529b828a030d1 Mon Sep 17 00:00:00 2001
2From: Lars-Peter Clausen <lars@metafoo.de>
3Date: Mon, 11 Jul 2016 13:54:17 +0200
4Subject: iio: ad799x: Fix buffered capture for ad7991/ad7995/ad7999
5
6From: Lars-Peter Clausen <lars@metafoo.de>
7
8commit 7d3cc21dab5313a02f2f3ca8164529b828a030d1 upstream.
9
10The data buffer for captured mode for the ad799x driver is allocated in the
11update_scan_mode() callback. This callback is not set in the iio_info
12struct for the ad7791/ad7995/ad7999, which means that the data buffer is
13not allocated when a captured transfer is started. As a result the driver
14crashes when the first sample is received. To fix this properly set the
15update_scan_mode() callback.
16
17Fixes: d8dca33027c1 ("staging:iio:ad799x: Preallocate sample buffer")
18Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
19Signed-off-by: Jonathan Cameron <jic23@kernel.org>
20Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21
22---
23 drivers/iio/adc/ad799x.c | 1 +
24 1 file changed, 1 insertion(+)
25
26--- a/drivers/iio/adc/ad799x.c
27+++ b/drivers/iio/adc/ad799x.c
28@@ -533,6 +533,7 @@ static struct attribute_group ad799x_eve
29 static const struct iio_info ad7991_info = {
30 .read_raw = &ad799x_read_raw,
31 .driver_module = THIS_MODULE,
32+ .update_scan_mode = ad799x_update_scan_mode,
33 };
34
35 static const struct iio_info ad7993_4_7_8_noirq_info = {