[PATCH v2] iio: adc: ti-ads1119: Reinit completion before wait_for_completion_timeout()
From: Felix Gu
Date: Tue Mar 03 2026 - 08:50:03 EST
The completion is not reinit before wait_for_completion_timeout(),
so wait_for_completion_timeout() will return immediately after
the first successful completion.
Fixes: a9306887eba4 ("iio: adc: ti-ads1119: Add driver")
Signed-off-by: Felix Gu <ustc.gu@xxxxxxxxx>
---
Changes in v2:
- Fix Jonathan's comment.
- Link to v1: https://lore.kernel.org/r/20260303-ti-ads1119-1-v1-1-e3fced089a44@xxxxxxxxx
---
drivers/iio/adc/ti-ads1119.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/iio/adc/ti-ads1119.c b/drivers/iio/adc/ti-ads1119.c
index c9cedc59cdcd..049cdb108dad 100644
--- a/drivers/iio/adc/ti-ads1119.c
+++ b/drivers/iio/adc/ti-ads1119.c
@@ -280,6 +280,9 @@ static int ads1119_single_conversion(struct ads1119_state *st,
if (ret)
goto pdown;
+ if (st->client->irq)
+ reinit_completion(&st->completion);
+
ret = i2c_smbus_write_byte(st->client, ADS1119_CMD_START_SYNC);
if (ret)
goto pdown;
---
base-commit: 3fa5e5702a82d259897bd7e209469bc06368bf31
change-id: 20260303-ti-ads1119-1-cc68e3c01783
Best regards,
--
Felix Gu <ustc.gu@xxxxxxxxx>