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>
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 @@
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;