iio: dac: ad5770r: fix error return in ad5770r_read_raw()

Return the error code from regmap_bulk_read() instead of 0 so
that I/O failures are properly propagated.

Fixes: cbbb819837 ("iio: dac: ad5770r: Add AD5770R support")
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Antoniu Miclaus
2026-03-12 13:20:24 +02:00
committed by Jonathan Cameron
parent 4f51e6c0ba
commit c354521708

View File

@@ -322,7 +322,7 @@ static int ad5770r_read_raw(struct iio_dev *indio_dev,
chan->address,
st->transf_buf, 2);
if (ret)
return 0;
return ret;
buf16 = get_unaligned_le16(st->transf_buf);
*val = buf16 >> 2;