From: Lars-Peter Clausen Date: Wed, 13 May 2015 14:04:45 +0000 (+0200) Subject: iio: __iio_update_buffers: Slightly refactor scan mask memory management X-Git-Tag: omap-for-v4.2/fixes-rc1^2~92^2~628^2~16 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=248be5aafc7cfe860b8f310bfc3f433e51f9fb11;p=pandora-kernel.git 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 Signed-off-by: Jonathan Cameron --- Reading git-diff-tree failed