staging:iio:ad7476: Avoid alloc/free for each sample in buffered mode
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 10 Sep 2012 08:34:00 +0000 (09:34 +0100)
committerJonathan Cameron <jic23@kernel.org>
Thu, 13 Sep 2012 19:25:49 +0000 (20:25 +0100)
commit93e33d703030fe0348c1ff9d8f40bc6c2d82dc30
treed413d688dc86f19ead5f8b24b91d8ea5153fb6c2
parentfcc7800b652e55420b85d1c885f39e8a230ace59
staging:iio:ad7476: Avoid alloc/free for each sample in buffered mode

The ad7476 driver has only support for 1 channel ADCs. So the upper limit for
the buffer size is the size of one sample plus the size of the timestamp.
Preallocate a buffer large enough to hold this to avoid having to allocate and
free a new buffer for each sample being captured.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/adc/ad7476.h
drivers/staging/iio/adc/ad7476_ring.c