summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2025-03-31 13:13:12 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2025-04-22 19:10:01 +0100
commit3e3f57659b3d1affc21c8315164fc60e3d2ed7c5 (patch)
tree234eb73d85affc462c0ae1bbc233a5d74d03c368
parent9dc7ed3bfe437b3a9fc5399fbe594a4b054eeeec (diff)
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>
-rw-r--r--drivers/iio/proximity/pulsedlight-lidar-lite-v2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
index f3d054b06b4c8..fbf9f85130559 100644
--- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
+++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
@@ -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, &reg);
@@ -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: