i2c: nvidia-gpu: adhere to I2C fault codes

As described in Documentation/i2c/fault-codes.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Fixes: c71bcdcb42 ("i2c: add i2c bus driver for NVIDIA GPU")
Acked-by: Ajay Gupta <ajayg@nvidia.com>
Tested-by: Ajay Gupta <ajayg@nvidia.com>
This commit is contained in:
Wolfram Sang 2018-11-09 18:02:16 +01:00
parent 2e6e902d18
commit 98be694ba2
1 changed files with 3 additions and 3 deletions

View File

@ -89,7 +89,7 @@ static int gpu_i2c_check_status(struct gpu_i2c_dev *i2cd)
if (time_is_before_jiffies(target)) { if (time_is_before_jiffies(target)) {
dev_err(i2cd->dev, "i2c timeout error %x\n", val); dev_err(i2cd->dev, "i2c timeout error %x\n", val);
return -ETIME; return -ETIMEDOUT;
} }
val = readl(i2cd->regs + I2C_MST_CNTL); val = readl(i2cd->regs + I2C_MST_CNTL);
@ -97,9 +97,9 @@ static int gpu_i2c_check_status(struct gpu_i2c_dev *i2cd)
case I2C_MST_CNTL_STATUS_OKAY: case I2C_MST_CNTL_STATUS_OKAY:
return 0; return 0;
case I2C_MST_CNTL_STATUS_NO_ACK: case I2C_MST_CNTL_STATUS_NO_ACK:
return -EIO; return -ENXIO;
case I2C_MST_CNTL_STATUS_TIMEOUT: case I2C_MST_CNTL_STATUS_TIMEOUT:
return -ETIME; return -ETIMEDOUT;
default: default:
return 0; return 0;
} }