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

+4 -5
+4 -5
drivers/iio/light/tcs3414.c
··· 134 134 135 135 switch (mask) { 136 136 case IIO_CHAN_INFO_RAW: 137 - ret = iio_device_claim_direct_mode(indio_dev); 138 - if (ret) 139 - return ret; 137 + if (!iio_device_claim_direct(indio_dev)) 138 + return -EBUSY; 140 139 ret = tcs3414_req_data(data); 141 140 if (ret < 0) { 142 - iio_device_release_direct_mode(indio_dev); 141 + iio_device_release_direct(indio_dev); 143 142 return ret; 144 143 } 145 144 ret = i2c_smbus_read_word_data(data->client, chan->address); 146 - iio_device_release_direct_mode(indio_dev); 145 + iio_device_release_direct(indio_dev); 147 146 if (ret < 0) 148 147 return ret; 149 148 *val = ret;