From 248be5aafc7cfe860b8f310bfc3f433e51f9fb11 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Wed, 13 May 2015 16:04:45 +0200 Subject: [PATCH] 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-format-patch failed