diff --git a/drivers/iio/chemical/sps30.c b/drivers/iio/chemical/sps30.c index e03a28a6714697710b71217b6f9d9a26fb5337cd..375df5060ed57b5bbca9990d4aa4376d84af34ab 100644 --- a/drivers/iio/chemical/sps30.c +++ b/drivers/iio/chemical/sps30.c @@ -210,7 +210,7 @@ static int sps30_do_meas(struct sps30_state *state, s32 *data, int size) msleep_interruptible(300); } - if (!tries) + if (tries == -1) return -ETIMEDOUT; ret = sps30_do_cmd(state, SPS30_READ_DATA, tmp, sizeof(int) * size);