mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 15:41:40 +00:00
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>
This commit is contained in:
parent
f8548ce0e0
commit
4671435c54
1 changed files with 2 additions and 2 deletions
|
@ -130,12 +130,12 @@ static int wait_for_irq(struct uniphier_fi2c_priv *priv, u32 flags,
|
||||||
if (irq & I2C_INT_AL) {
|
if (irq & I2C_INT_AL) {
|
||||||
dev_dbg(priv->dev, "error: arbitration lost\n");
|
dev_dbg(priv->dev, "error: arbitration lost\n");
|
||||||
*stop = false;
|
*stop = false;
|
||||||
return ret;
|
return -EDEADLK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (irq & I2C_INT_NA) {
|
if (irq & I2C_INT_NA) {
|
||||||
dev_dbg(priv->dev, "error: no answer\n");
|
dev_dbg(priv->dev, "error: no answer\n");
|
||||||
return ret;
|
return -ENODATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue