On 1/5/25 11:25 AM, Jonathan Cameron wrote: > From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> > > This complex cleanup.h use case of conditional guards has proved > to be more trouble that it is worth in terms of false positive compiler > warnings and hard to read code. > > Move directly to the new claim/release_direct() that allow sparse > to check for unbalanced context. > > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> > --- > drivers/iio/adc/ad4000.c | 61 +++++++++++++++++++++++++--------------- > 1 file changed, 38 insertions(+), 23 deletions(-) > > diff --git a/drivers/iio/adc/ad4000.c b/drivers/iio/adc/ad4000.c > index 1d556a842a68..ef0acaafbcdb 100644 ... > +static int ad4000_write_raw(struct iio_dev *indio_dev, > + struct iio_chan_spec const *chan, > + int val, int val2, long mask) > +{ > + int ret; > + > + switch (mask) { > + case IIO_CHAN_INFO_SCALE: > + Spurious blank line added. > + if (!iio_device_claim_direct(indio_dev)) > + return -EBUSY; > + ret = __ad4000_write_raw(indio_dev, chan, val2); > + iio_device_release_direct(indio_dev); > + return ret; > default: > return -EINVAL; > }