Skip to contentSkip to conversation

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

PATCH Applied Antoniu Miclaus 2 participants 2 messages Mar 12 – Mar 22

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 cbbb819837f6 ("iio: dac: ad5770r: Add AD5770R support")
---
 drivers/iio/dac/ad5770r.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ad5770r.c +1 -1
index cd47cb1c685c..6027e8d88b27 100644
@@ -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;
Signature · 1 line
2.43.0
maintainer Applied
#1 lore raw
Quoted 5 lines · On Thu, 12 Mar 2026 13:20:24 +0200 Antoniu Miclaus…

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")

Applied to the fixes-togreg branch of iio.git and marked for stable.

Thanks

Jonathan

Quoted 17 lines
---
 drivers/iio/dac/ad5770r.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ad5770r.c +1 -1
index cd47cb1c685c..6027e8d88b27 100644
@@ -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;