staging:iio:ad799x: Preallocate sample buffer
authorLars-Peter Clausen <lars@metafoo.de>
Tue, 26 Mar 2013 18:43:00 +0000 (18:43 +0000)
committerJonathan Cameron <jic23@kernel.org>
Fri, 29 Mar 2013 09:16:47 +0000 (09:16 +0000)
commitd8dca33027c1fda3318fe8af85456b801ef88e1e
tree470c0d2b64075ccb2cf57fd1e8cfd16e69f28ced
parentd00698df2180ecd78b2892856b310dfedd5f6fe7
staging:iio:ad799x: Preallocate sample buffer

Avoid allocating and freeing the sample buffer for each transfer. Instead
allocate it once when we start sampling. Also pre-compute the number of bytes we
need to transfer in the same way.

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