Re: [PATCH v2 27/27] iio: Drop iio_device_claim_direct_scoped() and related infrastructure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2025-02-09 at 18:06 +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
> 
> 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@xxxxxxxxxxxx>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
> ---

Reviewed-by: Nuno Sa <nuno.sa@xxxxxxxxxx>

>  include/linux/iio/iio.h | 27 ---------------------------
>  1 file changed, 27 deletions(-)
> 
> diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
> index 5ed03e36178f..07a0e8132e88 100644
> --- a/include/linux/iio/iio.h
> +++ b/include/linux/iio/iio.h
> @@ -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);
>  






[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux