]> git.baikalelectronics.ru Git - kernel.git/commit
staging:iio:ad7606: Avoid allocating buffer for each data capture
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 19 Oct 2016 17:07:01 +0000 (19:07 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 23 Oct 2016 18:34:14 +0000 (19:34 +0100)
commitc7167c000e03923c632c16be407838b1ff540abb
tree461cbc66908a95f7626ac11d85cfca962ebcdbf9
parent8ca683d4106adb826d5494c38d4f9ac0b5332d4d
staging:iio:ad7606: Avoid allocating buffer for each data capture

Currently the ad7606 driver dynamically allocates and frees a transfer
buffer each time a sample capture is performed in buffered mode, which
introduces unnecessary overhead. The driver state struct already contains a
buffer that is used for transfers in one-shot mode. This buffer is large
enough to hold all samples, but not the timestamp that might be present in
buffered mode. Extend the buffer size to be able to contain the timestamp
and update the buffered capture function to use this buffer.

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