mirror of
https://github.com/torvalds/linux.git
synced 2026-03-13 22:36:17 +01:00
iio: common: st_sensors: 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-8-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
0ceb75d0af
commit
f664ab98b2
1 changed files with 3 additions and 4 deletions
|
|
@ -530,9 +530,8 @@ int st_sensors_read_info_raw(struct iio_dev *indio_dev,
|
|||
int err;
|
||||
struct st_sensor_data *sdata = iio_priv(indio_dev);
|
||||
|
||||
err = iio_device_claim_direct_mode(indio_dev);
|
||||
if (err)
|
||||
return err;
|
||||
if (!iio_device_claim_direct(indio_dev))
|
||||
return -EBUSY;
|
||||
|
||||
mutex_lock(&sdata->odr_lock);
|
||||
|
||||
|
|
@ -551,7 +550,7 @@ int st_sensors_read_info_raw(struct iio_dev *indio_dev,
|
|||
|
||||
out:
|
||||
mutex_unlock(&sdata->odr_lock);
|
||||
iio_device_release_direct_mode(indio_dev);
|
||||
iio_device_release_direct(indio_dev);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue