Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: light: rpr0521: Switch to sparse friendly iio_device_claim/release_direct()

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.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250309170633.1347476-13-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

+2 -4
+2 -4
drivers/iio/light/rpr0521.c
··· 743 743 { 744 744 struct rpr0521_data *data = iio_priv(indio_dev); 745 745 int ret; 746 - int busy; 747 746 748 747 switch (mask) { 749 748 case IIO_CHAN_INFO_RAW: 750 749 if (chan->type != IIO_INTENSITY && chan->type != IIO_PROXIMITY) 751 750 return -EINVAL; 752 751 753 - busy = iio_device_claim_direct_mode(indio_dev); 754 - if (busy) 752 + if (!iio_device_claim_direct(indio_dev)) 755 753 return -EBUSY; 756 754 757 755 ret = rpr0521_read_info_raw(data, chan, val); 758 - iio_device_release_direct_mode(indio_dev); 756 + iio_device_release_direct(indio_dev); 759 757 if (ret < 0) 760 758 return ret; 761 759