> +static int maxim_thermocouple_read_raw(struct iio_dev *indio_dev, > + struct iio_chan_spec const *chan, > + int *val, int *val2, long mask) > +{ > + struct maxim_thermocouple_data *data = iio_priv(indio_dev); > + int ret = -EINVAL; > + > + mutex_lock(&indio_dev->mlock); > + Lets try to use here iio_device_claim_direct_mode wrappers. > + if (iio_buffer_enabled(indio_dev) && mask == IIO_CHAN_INFO_RAW) { > + ret = -EBUSY; > + goto error_busy; > + } thanks, Daniel. -- 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