iio: sanity check available_scan_masks array
authorMatti Vaittinen <mazziesaccount@gmail.com>
Mon, 16 Oct 2023 11:04:39 +0000 (14:04 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 16 Nov 2023 19:10:28 +0000 (19:10 +0000)
commit2718f15403fbbff4c4116824e02537e39342986a
treea6bb0bc2fb7d1063209461e6dd91ef2d42efa182
parente4cfeca8f8cb36e13a8764fc7605bb2f338be10b
iio: sanity check available_scan_masks array

When IIO goes through the available scan masks in order to select the
best suiting one, it will just accept the first listed subset of channels
which meets the user's requirements. If driver lists a mask which is a
subset of some of the masks previously in the array of
avaliable_scan_masks, then the latter one will never be selected.

Add a warning if driver registers masks which can't be used due to the
available_scan_masks-array ordering.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/e55ef0b26a6d3b323bab24920c131c79a01ba08e.1697452986.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/industrialio-core.c