Commit b015b3e3 authored by Matt Ranostay's avatar Matt Ranostay Committed by Jonathan Cameron

iio: chemical: atlas-ph-sensor: switch to iio_device_*_direct_mode helpers

Signed-off-by: default avatarMatt Ranostay <mranostay@gmail.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 4d671b71
...@@ -402,15 +402,13 @@ static int atlas_read_raw(struct iio_dev *indio_dev, ...@@ -402,15 +402,13 @@ static int atlas_read_raw(struct iio_dev *indio_dev,
case IIO_PH: case IIO_PH:
case IIO_CONCENTRATION: case IIO_CONCENTRATION:
case IIO_ELECTRICALCONDUCTIVITY: case IIO_ELECTRICALCONDUCTIVITY:
mutex_lock(&indio_dev->mlock); ret = iio_device_claim_direct_mode(indio_dev);
if (ret)
return ret;
if (iio_buffer_enabled(indio_dev)) ret = atlas_read_measurement(data, chan->address, &reg);
ret = -EBUSY;
else
ret = atlas_read_measurement(data,
chan->address, &reg);
mutex_unlock(&indio_dev->mlock); iio_device_release_direct_mode(indio_dev);
break; break;
default: default:
ret = -EINVAL; ret = -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment