iio: __iio_update_buffers: Slightly refactor scan mask memory management
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 13 May 2015 14:04:45 +0000 (16:04 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 17 May 2015 08:45:22 +0000 (09:45 +0100)
commit248be5aafc7cfe860b8f310bfc3f433e51f9fb11
treee42c9d84daba621a14f7f53518f628db0bce848b
parent63223c5f5c11b832586edca28cfc7d2850bc3e44
iio: __iio_update_buffers: Slightly refactor scan mask memory management

Add a small helper function iio_free_scan_mask() that takes a mask and
frees its memory if the scan masks for the device are dynamically
allocated, otherwise does nothing. This means we don't have to open-code
the same check over and over again in __iio_update_buffers.

Also free compound_mask as soon a we are done using it. This constrains its
usage to a specific region of the function will make further refactoring
and splitting the function into smaller sub-parts more easier.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/industrialio-buffer.c
This page took 0.024708 seconds and 5 git commands to generate.