On Mon, 2025-02-17 at 14:16 +0000, Jonathan Cameron wrote: > From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> > > These new functions allow sparse to find failures to release > direct mode reducing chances of bugs over the claim_direct_mode() > functions that are deprecated. > > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> > --- Reviewed-by: Nuno Sá <nuno.sa@xxxxxxxxxx> > drivers/iio/adc/ad7768-1.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/iio/adc/ad7768-1.c b/drivers/iio/adc/ad7768-1.c > index c2ba357b82d8..ea829c51e80b 100644 > --- a/drivers/iio/adc/ad7768-1.c > +++ b/drivers/iio/adc/ad7768-1.c > @@ -365,13 +365,12 @@ static int ad7768_read_raw(struct iio_dev *indio_dev, > > switch (info) { > case IIO_CHAN_INFO_RAW: > - ret = iio_device_claim_direct_mode(indio_dev); > - if (ret) > - return ret; > + if (!iio_device_claim_direct(indio_dev)) > + return -EBUSY; > > ret = ad7768_scan_direct(indio_dev); > > - iio_device_release_direct_mode(indio_dev); > + iio_device_release_direct(indio_dev); > if (ret < 0) > return ret; > *val = ret;