aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDai Okamura <okamura.dai@socionext.com>2022-12-09 20:38:27 +0900
committerTom Rini <trini@konsulko.com>2023-01-06 08:14:19 -0500
commit4671435c54ce79d3c671177cb47461d208186eae (patch)
treedee50a1a0d7cd815d0a522f7d0c64ad1050f7fb7
parentf8548ce0e09385926574283b17af6c2cd4e32af2 (diff)
downloadu-boot-4671435c54ce79d3c671177cb47461d208186eae.zip
u-boot-4671435c54ce79d3c671177cb47461d208186eae.tar.gz
u-boot-4671435c54ce79d3c671177cb47461d208186eae.tar.bz2
i2c: uniphier-f: correct error recovery
The uniphier i2c block can recognize some handshake errors. But driver handles all error detections as no error if no timeout. So this makes unrecoverable state. This replaces the return values with the right ones to tell the i2c framework the errors: - EDEADLK for arbitration lost error - ENODATA for no answer error Signed-off-by: Dai Okamura <okamura.dai@socionext.com> Acked-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Reviewed-by: Heiko Schocher <hs@denx.de>
-rw-r--r--drivers/i2c/i2c-uniphier-f.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-uniphier-f.c b/drivers/i2c/i2c-uniphier-f.c
index 9d6f168..3dcd382 100644
--- a/drivers/i2c/i2c-uniphier-f.c
+++ b/drivers/i2c/i2c-uniphier-f.c
@@ -130,12 +130,12 @@ static int wait_for_irq(struct uniphier_fi2c_priv *priv, u32 flags,
if (irq & I2C_INT_AL) {
dev_dbg(priv->dev, "error: arbitration lost\n");
*stop = false;
- return ret;
+ return -EDEADLK;
}
if (irq & I2C_INT_NA) {
dev_dbg(priv->dev, "error: no answer\n");
- return ret;
+ return -ENODATA;
}
return 0;