Commit 89388ca4 authored by Artur Rojek's avatar Artur Rojek Committed by Jonathan Cameron

iio: inkern: Convert iio_read_avail_channel_raw into a wrapper

Convert "iio_read_avail_channel_raw" over to a wrapper around
"iio_read_avail_channel_attribute".

With the introduction of "iio_read_avail_channel_attribute",
the necessity of having a separate call to read raw channel values
became redundant.
Signed-off-by: default avatarArtur Rojek <contact@artur-rojek.eu>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 9f421096
...@@ -759,16 +759,8 @@ int iio_read_avail_channel_raw(struct iio_channel *chan, ...@@ -759,16 +759,8 @@ int iio_read_avail_channel_raw(struct iio_channel *chan,
int ret; int ret;
int type; int type;
mutex_lock(&chan->indio_dev->info_exist_lock); ret = iio_read_avail_channel_attribute(chan, vals, &type, length,
if (!chan->indio_dev->info) { IIO_CHAN_INFO_RAW);
ret = -ENODEV;
goto err_unlock;
}
ret = iio_channel_read_avail(chan,
vals, &type, length, IIO_CHAN_INFO_RAW);
err_unlock:
mutex_unlock(&chan->indio_dev->info_exist_lock);
if (ret >= 0 && type != IIO_VAL_INT) if (ret >= 0 && type != IIO_VAL_INT)
/* raw values are assumed to be IIO_VAL_INT */ /* raw values are assumed to be IIO_VAL_INT */
......
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