Commit b1e18768 authored by Colin Ian King's avatar Colin Ian King Committed by Jonathan Cameron

iio: dac: ad5380: fix incorrect assignment to val

Currently the pointer val is being incorrectly incremented
instead of the value pointed to by val. Fix this by adding
in the missing * indirection operator.

Addresses-Coverity: ("Unused value")
Fixes: c03f2c53 ("staging:iio:dac: Add AD5380 driver")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Reviewed-by: default avatarAlexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 70575abe
...@@ -220,7 +220,7 @@ static int ad5380_read_raw(struct iio_dev *indio_dev, ...@@ -220,7 +220,7 @@ static int ad5380_read_raw(struct iio_dev *indio_dev,
if (ret) if (ret)
return ret; return ret;
*val >>= chan->scan_type.shift; *val >>= chan->scan_type.shift;
val -= (1 << chan->scan_type.realbits) / 2; *val -= (1 << chan->scan_type.realbits) / 2;
return IIO_VAL_INT; return IIO_VAL_INT;
case IIO_CHAN_INFO_SCALE: case IIO_CHAN_INFO_SCALE:
*val = 2 * st->vref; *val = 2 * st->vref;
......
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