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: tcs3472: 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-17-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

+4 -5
+4 -5
drivers/iio/light/tcs3472.c
··· 148 148 149 149 switch (mask) { 150 150 case IIO_CHAN_INFO_RAW: 151 - ret = iio_device_claim_direct_mode(indio_dev); 152 - if (ret) 153 - return ret; 151 + if (!iio_device_claim_direct(indio_dev)) 152 + return -EBUSY; 154 153 ret = tcs3472_req_data(data); 155 154 if (ret < 0) { 156 - iio_device_release_direct_mode(indio_dev); 155 + iio_device_release_direct(indio_dev); 157 156 return ret; 158 157 } 159 158 ret = i2c_smbus_read_word_data(data->client, chan->address); 160 - iio_device_release_direct_mode(indio_dev); 159 + iio_device_release_direct(indio_dev); 161 160 if (ret < 0) 162 161 return ret; 163 162 *val = ret;