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: rohm-bu27034: 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.

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

+6 -8
+6 -8
drivers/iio/light/rohm-bu27034.c
··· 998 998 return -EINVAL; 999 999 1000 1000 /* Don't mess with measurement enabling while buffering */ 1001 - ret = iio_device_claim_direct_mode(idev); 1002 - if (ret) 1003 - return ret; 1001 + if (!iio_device_claim_direct(idev)) 1002 + return -EBUSY; 1004 1003 1005 1004 mutex_lock(&data->mutex); 1006 1005 /* ··· 1010 1011 ret = result_get(data, chan->channel, val); 1011 1012 1012 1013 mutex_unlock(&data->mutex); 1013 - iio_device_release_direct_mode(idev); 1014 + iio_device_release_direct(idev); 1014 1015 1015 1016 if (ret) 1016 1017 return ret; ··· 1049 1050 struct bu27034_data *data = iio_priv(idev); 1050 1051 int ret; 1051 1052 1052 - ret = iio_device_claim_direct_mode(idev); 1053 - if (ret) 1054 - return ret; 1053 + if (!iio_device_claim_direct(idev)) 1054 + return -EBUSY; 1055 1055 1056 1056 switch (mask) { 1057 1057 case IIO_CHAN_INFO_SCALE: ··· 1067 1069 break; 1068 1070 } 1069 1071 1070 - iio_device_release_direct_mode(idev); 1072 + iio_device_release_direct(idev); 1071 1073 1072 1074 return ret; 1073 1075 }