Skip to content

Commit

Permalink
i2c: nvidia-gpu: adhere to I2C fault codes
Browse files Browse the repository at this point in the history
As described in Documentation/i2c/fault-codes.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Fixes: c71bcdc ("i2c: add i2c bus driver for NVIDIA GPU")
Acked-by: Ajay Gupta <ajayg@nvidia.com>
Tested-by: Ajay Gupta <ajayg@nvidia.com>
  • Loading branch information
Wolfram Sang committed Nov 27, 2018
1 parent 2e6e902 commit 98be694
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/i2c/busses/i2c-nvidia-gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ static int gpu_i2c_check_status(struct gpu_i2c_dev *i2cd)

if (time_is_before_jiffies(target)) {
dev_err(i2cd->dev, "i2c timeout error %x\n", val);
return -ETIME;
return -ETIMEDOUT;
}

val = readl(i2cd->regs + I2C_MST_CNTL);
switch (val & I2C_MST_CNTL_STATUS) {
case I2C_MST_CNTL_STATUS_OKAY:
return 0;
case I2C_MST_CNTL_STATUS_NO_ACK:
return -EIO;
return -ENXIO;
case I2C_MST_CNTL_STATUS_TIMEOUT:
return -ETIME;
return -ETIMEDOUT;
default:
return 0;
}
Expand Down

0 comments on commit 98be694

Please sign in to comment.