On 03/23/2017 06:36 PM, Narcisa Ana Maria Vasile wrote: [...] > @@ -415,7 +420,10 @@ static ssize_t ad5933_store(struct device *dev, > return ret; > } > > - mutex_lock(&indio_dev->mlock); > + ret = iio_device_claim_direct_mode(indio_dev); > + if (ret) > + return ret; This is a change in semantics. Previously it was possible to change the attributes while in buffered mode, but now it no longer is. This is probably OK, but should certainly be noted in the commit message. > + mutex_lock(&st->lock); > switch ((u32)this_attr->address) { > case AD5933_OUT_RANGE: > ret = -EINVAL; > @@ -465,7 +473,8 @@ static ssize_t ad5933_store(struct device *dev, > ret = -EINVAL; > } > > - mutex_unlock(&indio_dev->mlock); > + mutex_unlock(&st->lock); > + iio_device_release_direct_mode(indio_dev); > return ret ? ret : len; > } > > @@ -532,11 +541,9 @@ static int ad5933_read_raw(struct iio_dev *indio_dev, > > switch (m) { > case IIO_CHAN_INFO_RAW: > - mutex_lock(&indio_dev->mlock); > - if (iio_buffer_enabled(indio_dev)) { > - ret = -EBUSY; > - goto out; > - } > + ret = iio_device_claim_direct_mode(indio_dev); > + if (ret) > + return ret; > ret = ad5933_cmd(st, AD5933_CTRL_MEASURE_TEMP); > if (ret < 0) > goto out; > @@ -549,7 +556,7 @@ static int ad5933_read_raw(struct iio_dev *indio_dev, > 2, (u8 *)&dat); > if (ret < 0) > goto out; > - mutex_unlock(&indio_dev->mlock); > + iio_device_release_direct_mode(indio_dev); > *val = sign_extend32(be16_to_cpu(dat), 13); > > return IIO_VAL_INT; > @@ -561,7 +568,7 @@ static int ad5933_read_raw(struct iio_dev *indio_dev, > > return -EINVAL; > out: > - mutex_unlock(&indio_dev->mlock); > + iio_device_release_direct_mode(indio_dev); > return ret; > } > -- 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