[PATCH v2 2/2] i2c: ocores: respect adapter timeout in IRQ mode
From: Matthias Schiffer
Date: Thu Oct 09 2025 - 05:22:21 EST
While the timeout field of the i2c_adapter defaults to 1s, it can be
changed, for example using the I2C_TIMEOUT ioctl. Change the ocores
driver to use this timeout instead of hardcoding 1s, also making it
consistent with polling mode.
Signed-off-by: Matthias Schiffer <matthias.schiffer@xxxxxxxxxxxxxxx>
Acked-by: Peter Korsgaard <peter@xxxxxxxxxxxxx>
---
v2: collect acked-by
drivers/i2c/busses/i2c-ocores.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
index c4587194d46be..4a8ce167a3d9f 100644
--- a/drivers/i2c/busses/i2c-ocores.c
+++ b/drivers/i2c/busses/i2c-ocores.c
@@ -383,7 +383,8 @@ static int ocores_xfer_core(struct ocores_i2c *i2c,
} else {
if (wait_event_timeout(i2c->wait,
(i2c->state == STATE_ERROR) ||
- (i2c->state == STATE_DONE), HZ) == 0)
+ (i2c->state == STATE_DONE),
+ i2c->adap.timeout) == 0)
ret = -ETIMEDOUT;
}
if (ret) {
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/