summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWolfram Sang <wsa@kernel.org>2023-02-20 15:40:59 +0100
committerWolfram Sang <wsa@kernel.org>2023-03-03 21:00:26 +0100
commit4b3dfb0ed6336dea4a763ce9fa30a42763eb3800 (patch)
treed39a7440fb17f1f035e434f5dcdea048700ec839 /drivers
parent1d092308ce223bb1403475737b8fb847e9e8704c (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/busses/i2c-gxp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-gxp.c b/drivers/i2c/busses/i2c-gxp.c
index 352dedf6292f..fda7809e72ba 100644
--- a/drivers/i2c/busses/i2c-gxp.c
+++ b/drivers/i2c/busses/i2c-gxp.c
@@ -129,8 +129,10 @@ static int gxp_i2c_master_xfer(struct i2c_adapter *adapter,
if (time_left == 0)
return -ETIMEDOUT;
- if (drvdata->state == GXP_I2C_ADDR_NACK ||
- drvdata->state == GXP_I2C_DATA_NACK)
+ if (drvdata->state == GXP_I2C_ADDR_NACK)
+ return -ENXIO;
+
+ if (drvdata->state == GXP_I2C_DATA_NACK)
return -EIO;
return ret;