iio: pressure: rohm-bm1390: Return error when read fails

The data reading function ignores the cached error value, and
unconditionally returns 0. Return cached 'ret' -value after stopping
the measurement so user knows if read failed and data is garbage.

Fixes: 534674463a ("iio: bm1390: simplify using guard(mutex)")
Signed-off-by: Matti Vaittinen <[email protected]>
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
This commit is contained in:
Matti Vaittinen authored and Jonathan Cameron committed 2026-08-31 00:52:41 +01:00
1 parent 55671fbc3d
commit b0e951ffc5
1 file changed
+1 -1
+1 -1
View File
@@ -289,7 +289,7 @@ static int bm1390_read_data(struct bm1390_data *data,
if (warn)
dev_warn(data->dev, "Failed to stop measurement (%d)\n", warn);
return 0;
return ret;
}
static int bm1390_read_raw(struct iio_dev *idev,