|
@@ -154,8 +154,10 @@ static int ec_i2c_parse_response(const u8 *buf, struct i2c_msg i2c_msgs[],
|
|
|
resp = (const struct ec_response_i2c_passthru *)buf;
|
|
|
if (resp->i2c_status & EC_I2C_STATUS_TIMEOUT)
|
|
|
return -ETIMEDOUT;
|
|
|
+ else if (resp->i2c_status & EC_I2C_STATUS_NAK)
|
|
|
+ return -ENXIO;
|
|
|
else if (resp->i2c_status & EC_I2C_STATUS_ERROR)
|
|
|
- return -EREMOTEIO;
|
|
|
+ return -EIO;
|
|
|
|
|
|
/* Other side could send us back fewer messages, but not more */
|
|
|
if (resp->num_msgs > *num)
|
|
@@ -222,10 +224,8 @@ static int ec_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg i2c_msgs[],
|
|
|
}
|
|
|
|
|
|
result = ec_i2c_parse_response(msg->data, i2c_msgs, &num);
|
|
|
- if (result < 0) {
|
|
|
- dev_err(dev, "Error parsing EC i2c message %d\n", result);
|
|
|
+ if (result < 0)
|
|
|
goto exit;
|
|
|
- }
|
|
|
|
|
|
/* Indicate success by saying how many messages were sent */
|
|
|
result = num;
|