mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 20:02:10 -04:00
iio: proximity: pulsed-light: 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> Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com> Link: https://patch.msgid.link/20250331121317.1694135-33-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
@@ -208,7 +208,7 @@ static int lidar_read_raw(struct iio_dev *indio_dev,
|
||||
case IIO_CHAN_INFO_RAW: {
|
||||
u16 reg;
|
||||
|
||||
if (iio_device_claim_direct_mode(indio_dev))
|
||||
if (!iio_device_claim_direct(indio_dev))
|
||||
return -EBUSY;
|
||||
|
||||
ret = lidar_get_measurement(data, ®);
|
||||
@@ -216,7 +216,7 @@ static int lidar_read_raw(struct iio_dev *indio_dev,
|
||||
*val = reg;
|
||||
ret = IIO_VAL_INT;
|
||||
}
|
||||
iio_device_release_direct_mode(indio_dev);
|
||||
iio_device_release_direct(indio_dev);
|
||||
break;
|
||||
}
|
||||
case IIO_CHAN_INFO_SCALE:
|
||||
|
||||
Reference in New Issue
Block a user