diff options
author | Jan Glauber <jglauber@cavium.com> | 2018-02-27 16:42:13 +0100 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2018-03-02 11:11:15 +0100 |
commit | 7c4246797b84e55e2dfaaf8a18033de9df7c18c1 (patch) | |
tree | 0b330bd0142741696b6bc8abaa973c46f945fcb2 | |
parent | 1a0e3a35c651b56db59a28b5f693cdf9d4582b56 (diff) | |
download | lwn-7c4246797b84e55e2dfaaf8a18033de9df7c18c1.tar.gz lwn-7c4246797b84e55e2dfaaf8a18033de9df7c18c1.zip |
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: Jan Glauber <jglauber@cavium.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
-rw-r--r-- | drivers/i2c/busses/i2c-octeon-core.c | 1 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-octeon-core.h | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-octeon-core.c b/drivers/i2c/busses/i2c-octeon-core.c index 1d8775799056..d9607905dc2f 100644 --- a/drivers/i2c/busses/i2c-octeon-core.c +++ b/drivers/i2c/busses/i2c-octeon-core.c @@ -233,6 +233,7 @@ static int octeon_i2c_check_status(struct octeon_i2c *i2c, int final_read) return -EOPNOTSUPP; case STAT_TXDATA_NAK: + case STAT_BUS_ERROR: return -EIO; case STAT_TXADDR_NAK: case STAT_RXADDR_NAK: diff --git a/drivers/i2c/busses/i2c-octeon-core.h b/drivers/i2c/busses/i2c-octeon-core.h index a7ef19855bb8..9bb9f64fdda0 100644 --- a/drivers/i2c/busses/i2c-octeon-core.h +++ b/drivers/i2c/busses/i2c-octeon-core.h @@ -43,7 +43,7 @@ #define TWSI_CTL_AAK 0x04 /* Assert ACK */ /* Status values */ -#define STAT_ERROR 0x00 +#define STAT_BUS_ERROR 0x00 #define STAT_START 0x08 #define STAT_REP_START 0x10 #define STAT_TXADDR_ACK 0x18 |