diff options
author | Artur Rojek <contact@artur-rojek.eu> | 2019-03-23 13:28:07 -0400 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2019-04-14 06:32:20 -0400 |
commit | 89388ca4955fe2f70936488723c9bb74099f37a3 (patch) | |
tree | e57b950870e2540a7989784b7c5cb72eaca8df38 | |
parent | 9f421096a16e75d22e69f766206f1bb0dc8fcf90 (diff) |
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: Artur Rojek <contact@artur-rojek.eu>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r-- | drivers/iio/inkern.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index f19dbde3c945..4a5eff3f18bc 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c | |||
@@ -759,16 +759,8 @@ int iio_read_avail_channel_raw(struct iio_channel *chan, | |||
759 | int ret; | 759 | int ret; |
760 | int type; | 760 | int type; |
761 | 761 | ||
762 | mutex_lock(&chan->indio_dev->info_exist_lock); | 762 | ret = iio_read_avail_channel_attribute(chan, vals, &type, length, |
763 | if (!chan->indio_dev->info) { | 763 | IIO_CHAN_INFO_RAW); |
764 | ret = -ENODEV; | ||
765 | goto err_unlock; | ||
766 | } | ||
767 | |||
768 | ret = iio_channel_read_avail(chan, | ||
769 | vals, &type, length, IIO_CHAN_INFO_RAW); | ||
770 | err_unlock: | ||
771 | mutex_unlock(&chan->indio_dev->info_exist_lock); | ||
772 | 764 | ||
773 | if (ret >= 0 && type != IIO_VAL_INT) | 765 | if (ret >= 0 && type != IIO_VAL_INT) |
774 | /* raw values are assumed to be IIO_VAL_INT */ | 766 | /* raw values are assumed to be IIO_VAL_INT */ |