iio: core: move to cleanup.h magic
authorNuno Sa <nuno.sa@analog.com>
Thu, 29 Feb 2024 15:10:25 +0000 (16:10 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 25 Mar 2024 20:10:14 +0000 (20:10 +0000)
commit42ea59925387e8468f490155ffdc382aba2539ae
treecec04809b489cf95ccbd832bf0c23345c5106a9d
parent305914d018077a125b0541b196ed080804f72106
iio: core: move to cleanup.h magic

Use the new cleanup magic for handling mutexes in IIO. This allows us to
greatly simplify some code paths.

Note that we keep the plain mutex calls in the
iio_device_release|acquire() APIs since in there the macros would likely
not help much (as we want to keep the lock acquired when he leave the
APIs).

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240229-iio-use-cleanup-magic-v3-1-c3d34889ae3c@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/industrialio-core.c