]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: dac: ad5770r: fix error return in ad5770r_read_raw()
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Thu, 12 Mar 2026 11:20:24 +0000 (13:20 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 22 Mar 2026 11:46:26 +0000 (11:46 +0000)
Return the error code from regmap_bulk_read() instead of 0 so
that I/O failures are properly propagated.

Fixes: cbbb819837f6 ("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>
drivers/iio/dac/ad5770r.c

index cd47cb1c685c4d3ef117bfc59e0e2e45b11e7b7c..6027e8d88b2781b7b83668c508a2ce2c6030900c 100644 (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;