iio: ad799x: Fix buffered capture for ad7991/ad7995/ad7999
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 11 Jul 2016 11:54:17 +0000 (13:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Sep 2016 08:07:38 +0000 (10:07 +0200)
commit734ee23cd4c134ed046812c82302fe05543b3b92
treef68b974ffa2e34e82f646e8faa74509861fcb2d1
parent023e76b1d1fd4857ba6af6e99dfbefd667aae6d1
iio: ad799x: Fix buffered capture for ad7991/ad7995/ad7999

commit 7d3cc21dab5313a02f2f3ca8164529b828a030d1 upstream.

The data buffer for captured mode for the ad799x driver is allocated in the
update_scan_mode() callback. This callback is not set in the iio_info
struct for the ad7791/ad7995/ad7999, which means that the data buffer is
not allocated when a captured transfer is started. As a result the driver
crashes when the first sample is received. To fix this properly set the
update_scan_mode() callback.

Fixes: d8dca33027c1 ("staging:iio:ad799x: Preallocate sample buffer")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/ad799x.c