mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 13:43:28 +00:00
drivers: mediatek: Fix error handling in mtk_i2c_do_transfer
Errors were handled only if an I2C transfer timed out and received a NACK which is very unlikely. This commit changes the condition such that errors are handled if an I2C transfer times out or received a NACK. Signed-off-by: Francois Berder <fberder@outlook.fr> Reviewed-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
c5b42e3e9e
commit
8cf61051ae
1 changed files with 1 additions and 1 deletions
|
@ -621,7 +621,7 @@ static int mtk_i2c_do_transfer(struct mtk_i2c_priv *priv,
|
|||
i2c_writel(priv, REG_INTR_MASK, ~(restart_flag | I2C_HS_NACKERR |
|
||||
I2C_ACKERR | I2C_TRANSAC_COMP));
|
||||
|
||||
if (!tmo && trans_error != 0) {
|
||||
if (tmo || trans_error != 0) {
|
||||
if (tmo) {
|
||||
ret = -ETIMEDOUT;
|
||||
if (!priv->filter_msg)
|
||||
|
|
Loading…
Reference in a new issue