Commit 7c424679 authored by Jan Glauber's avatar Jan Glauber Committed by Wolfram Sang

i2c: octeon: Prevent error message on bus error

The error message:

[Fri Feb 16 13:42:13 2018] i2c-thunderx 0000:01:09.4: unhandled state: 0

is mis-leading as state 0 (bus error) is not an unknown state.

Return -EIO as before but avoid printing the message. Also rename
STAT_ERROR to STATE_BUS_ERROR.
Signed-off-by: default avatarJan Glauber <jglauber@cavium.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 1a0e3a35
...@@ -233,6 +233,7 @@ static int octeon_i2c_check_status(struct octeon_i2c *i2c, int final_read) ...@@ -233,6 +233,7 @@ static int octeon_i2c_check_status(struct octeon_i2c *i2c, int final_read)
return -EOPNOTSUPP; return -EOPNOTSUPP;
case STAT_TXDATA_NAK: case STAT_TXDATA_NAK:
case STAT_BUS_ERROR:
return -EIO; return -EIO;
case STAT_TXADDR_NAK: case STAT_TXADDR_NAK:
case STAT_RXADDR_NAK: case STAT_RXADDR_NAK:
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#define TWSI_CTL_AAK 0x04 /* Assert ACK */ #define TWSI_CTL_AAK 0x04 /* Assert ACK */
/* Status values */ /* Status values */
#define STAT_ERROR 0x00 #define STAT_BUS_ERROR 0x00
#define STAT_START 0x08 #define STAT_START 0x08
#define STAT_REP_START 0x10 #define STAT_REP_START 0x10
#define STAT_TXADDR_ACK 0x18 #define STAT_TXADDR_ACK 0x18
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment