On Mon, Aug 15, 2016 at 8:14 AM, Jonathan Cameron <jic23@xxxxxxxxxx> wrote: > On 10/08/16 04:05, Matt Ranostay wrote: >> Signed-off-by: Matt Ranostay <mranostay@xxxxxxxxx> >> --- >> drivers/iio/chemical/atlas-ph-sensor.c | 6 ++++-- >> 1 file changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/iio/chemical/atlas-ph-sensor.c b/drivers/iio/chemical/atlas-ph-sensor.c >> index ae038a59d256..8e39b37a5385 100644 >> --- a/drivers/iio/chemical/atlas-ph-sensor.c >> +++ b/drivers/iio/chemical/atlas-ph-sensor.c >> @@ -402,7 +402,9 @@ static int atlas_read_raw(struct iio_dev *indio_dev, >> case IIO_PH: >> case IIO_CONCENTRATION: >> 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 = -EBUSY; > The claim_direct_mode helpers also perform this check... Gah should have noticed this... Will fix in v2! > > >> @@ -410,7 +412,7 @@ static int atlas_read_raw(struct iio_dev *indio_dev, >> ret = atlas_read_measurement(data, >> chan->address, ®); >> >> - mutex_unlock(&indio_dev->mlock); >> + iio_device_release_direct_mode(indio_dev); >> break; >> default: >> ret = -EINVAL; >> > -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html