mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 12:53:14 +01:00
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:
1 parent
55671fbc3d
commit
b0e951ffc5
1 file changed
+1
-1
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user