mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 12:53:04 -04:00
iio: pressure: rohm-bm1390: 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: Matti Vaittinen <mazziesaccount@gmail.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com> Link: https://patch.msgid.link/20250331121317.1694135-30-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
@@ -319,12 +319,11 @@ static int bm1390_read_raw(struct iio_dev *idev,
|
||||
|
||||
return -EINVAL;
|
||||
case IIO_CHAN_INFO_RAW:
|
||||
ret = iio_device_claim_direct_mode(idev);
|
||||
if (ret)
|
||||
return ret;
|
||||
if (!iio_device_claim_direct(idev))
|
||||
return -EBUSY;
|
||||
|
||||
ret = bm1390_read_data(data, chan, val, val2);
|
||||
iio_device_release_direct_mode(idev);
|
||||
iio_device_release_direct(idev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user