Skip to content

Commit 4b3dfb0

Browse files
committed
i2c: gxp: return proper error on address NACK
According to Documentation/i2c/fault-codes.rst, NACK after sending an address should be -ENXIO. Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent 1d09230 commit 4b3dfb0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/i2c/busses/i2c-gxp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,10 @@ static int gxp_i2c_master_xfer(struct i2c_adapter *adapter,
129129
if (time_left == 0)
130130
return -ETIMEDOUT;
131131

132-
if (drvdata->state == GXP_I2C_ADDR_NACK ||
133-
drvdata->state == GXP_I2C_DATA_NACK)
132+
if (drvdata->state == GXP_I2C_ADDR_NACK)
133+
return -ENXIO;
134+
135+
if (drvdata->state == GXP_I2C_DATA_NACK)
134136
return -EIO;
135137

136138
return ret;

0 commit comments

Comments
 (0)