]>
Commit | Line | Data |
---|---|---|
6bd99ffc GKH |
1 | From 7d3cc21dab5313a02f2f3ca8164529b828a030d1 Mon Sep 17 00:00:00 2001 |
2 | From: Lars-Peter Clausen <lars@metafoo.de> | |
3 | Date: Mon, 11 Jul 2016 13:54:17 +0200 | |
4 | Subject: iio: ad799x: Fix buffered capture for ad7991/ad7995/ad7999 | |
5 | ||
6 | From: Lars-Peter Clausen <lars@metafoo.de> | |
7 | ||
8 | commit 7d3cc21dab5313a02f2f3ca8164529b828a030d1 upstream. | |
9 | ||
10 | The data buffer for captured mode for the ad799x driver is allocated in the | |
11 | update_scan_mode() callback. This callback is not set in the iio_info | |
12 | struct for the ad7791/ad7995/ad7999, which means that the data buffer is | |
13 | not allocated when a captured transfer is started. As a result the driver | |
14 | crashes when the first sample is received. To fix this properly set the | |
15 | update_scan_mode() callback. | |
16 | ||
17 | Fixes: d8dca33027c1 ("staging:iio:ad799x: Preallocate sample buffer") | |
18 | Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> | |
19 | Signed-off-by: Jonathan Cameron <jic23@kernel.org> | |
20 | Signed-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 = { |