mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 15:18:19 +00:00
iio: Fix iio_read_channel_processed_scale()
The code was checking if (ret) from the processed
channel readout, not smart, we need to check if (ret < 0)
as this will likely be something like IIO_VAL_INT.
Fixes: 635ef601b2
("iio: Provide iio_read_channel_processed_scale() API")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210323122705.1326362-1-linus.walleij@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
3e55bb6f2a
commit
b3b64e2c15
1 changed files with 1 additions and 1 deletions
|
@ -702,7 +702,7 @@ int iio_read_channel_processed_scale(struct iio_channel *chan, int *val,
|
|||
if (iio_channel_has_info(chan->channel, IIO_CHAN_INFO_PROCESSED)) {
|
||||
ret = iio_channel_read(chan, val, NULL,
|
||||
IIO_CHAN_INFO_PROCESSED);
|
||||
if (ret)
|
||||
if (ret < 0)
|
||||
goto err_unlock;
|
||||
*val *= scale;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue