summaryrefslogtreecommitdiff
path: root/drivers/iio/pressure/mprls0025pa.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/pressure/mprls0025pa.c')
-rw-r--r--drivers/iio/pressure/mprls0025pa.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/iio/pressure/mprls0025pa.c b/drivers/iio/pressure/mprls0025pa.c
index e3f0de020a40..233cc1dc38ad 100644
--- a/drivers/iio/pressure/mprls0025pa.c
+++ b/drivers/iio/pressure/mprls0025pa.c
@@ -39,6 +39,8 @@
#define MPR_I2C_MEMORY BIT(2) /* integrity test passed */
#define MPR_I2C_MATH BIT(0) /* internal math saturation */
+#define MPR_I2C_ERR_FLAG (MPR_I2C_BUSY | MPR_I2C_MEMORY | MPR_I2C_MATH)
+
/*
* support _RAW sysfs interface:
*
@@ -213,7 +215,7 @@ static int mpr_read_pressure(struct mpr_data *data, s32 *press)
status);
return status;
}
- if (!(status & MPR_I2C_BUSY))
+ if (!(status & MPR_I2C_ERR_FLAG))
break;
}
if (i == nloops) {
@@ -233,7 +235,7 @@ static int mpr_read_pressure(struct mpr_data *data, s32 *press)
return -EIO;
}
- if (buf[0] & MPR_I2C_BUSY) {
+ if (buf[0] & MPR_I2C_ERR_FLAG) {
/*
* it should never be the case that status still indicates
* business