]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: Drop iio_device_claim_direct_scoped() and related infrastructure
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 9 Feb 2025 18:06:24 +0000 (18:06 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 17 Feb 2025 13:04:09 +0000 (13:04 +0000)
Scoped conditional automated cleanup turned out to be harder to work
with than expected. Despite several attempts to find a better solution
non have surfaced. As such rip it out of the IIO code.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20250209180624.701140-28-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
include/linux/iio/iio.h

index 5ed03e36178fc2b7eb045337077e5670da54a9fe..07a0e8132e88278c82be740e12ca2d9078710206 100644 (file)
@@ -9,7 +9,6 @@
 
 #include <linux/device.h>
 #include <linux/cdev.h>
-#include <linux/cleanup.h>
 #include <linux/compiler_types.h>
 #include <linux/slab.h>
 #include <linux/iio/types.h>
@@ -688,32 +687,6 @@ static inline void iio_device_release_direct(struct iio_dev *indio_dev)
        __release(indio_dev);
 }
 
-/*
- * This autocleanup logic is normally used via
- * iio_device_claim_direct_scoped().
- */
-DEFINE_GUARD(iio_claim_direct, struct iio_dev *, iio_device_claim_direct_mode(_T),
-            iio_device_release_direct_mode(_T))
-
-DEFINE_GUARD_COND(iio_claim_direct, _try, ({
-                       struct iio_dev *dev;
-                       int d = iio_device_claim_direct_mode(_T);
-
-                       if (d < 0)
-                               dev = NULL;
-                       else
-                               dev = _T;
-                       dev;
-               }))
-
-/**
- * iio_device_claim_direct_scoped() - Scoped call to iio_device_claim_direct.
- * @fail: What to do on failure to claim device.
- * @iio_dev: Pointer to the IIO devices structure
- */
-#define iio_device_claim_direct_scoped(fail, iio_dev) \
-       scoped_cond_guard(iio_claim_direct_try, fail, iio_dev)
-
 int iio_device_claim_buffer_mode(struct iio_dev *indio_dev);
 void iio_device_release_buffer_mode(struct iio_dev *indio_dev);