diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/algos/i2c-algo-bit.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c index 260c5d70b0b4..35812823787b 100644 --- a/drivers/i2c/algos/i2c-algo-bit.c +++ b/drivers/i2c/algos/i2c-algo-bit.c | |||
@@ -357,10 +357,26 @@ static int sendbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg) | |||
357 | count--; | 357 | count--; |
358 | temp++; | 358 | temp++; |
359 | wrcount++; | 359 | wrcount++; |
360 | } else { /* arbitration or no acknowledge */ | 360 | |
361 | dev_err(&i2c_adap->dev, "sendbytes: error - bailout.\n"); | 361 | /* A slave NAKing the master means the slave didn't like |
362 | return (retval<0)? retval : -EFAULT; | 362 | * something about the data it saw. For example, maybe |
363 | /* got a better one ?? */ | 363 | * the SMBus PEC was wrong. |
364 | */ | ||
365 | } else if (retval == 0) { | ||
366 | dev_err(&i2c_adap->dev, "sendbytes: NAK bailout.\n"); | ||
367 | return -EIO; | ||
368 | |||
369 | /* Timeout; or (someday) lost arbitration | ||
370 | * | ||
371 | * FIXME Lost ARB implies retrying the transaction from | ||
372 | * the first message, after the "winning" master issues | ||
373 | * its STOP. As a rule, upper layer code has no reason | ||
374 | * to know or care about this ... it is *NOT* an error. | ||
375 | */ | ||
376 | } else { | ||
377 | dev_err(&i2c_adap->dev, "sendbytes: error %d\n", | ||
378 | retval); | ||
379 | return retval; | ||
364 | } | 380 | } |
365 | } | 381 | } |
366 | return wrcount; | 382 | return wrcount; |