Commit fbf40727 authored by Javier Martinez Canillas's avatar Javier Martinez Canillas Committed by Olof Johansson

platform/chrome: cros_ec_lpc - Use existing function to check EC result

Commit 6db07b63 ("mfd: cros_ec: Check result code from EC messages")
added a common cros_ec_check_result() function that can be used to check
the ec_msg->result for errors and warns about them.

Use the existing function instead of duplicating same check in the driver.
Signed-off-by: default avatarJavier Martinez Canillas <javier.martinez@collabora.co.uk>
Reviewed-by: default avatarGwendal Grignou <gwendal@chromium.org>
Tested-by: default avatarGwendal Grignou <gwendal@chromium.org>
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parent 75529a9d
...@@ -166,19 +166,9 @@ static int cros_ec_cmd_xfer_lpc(struct cros_ec_device *ec, ...@@ -166,19 +166,9 @@ static int cros_ec_cmd_xfer_lpc(struct cros_ec_device *ec,
/* Check result */ /* Check result */
msg->result = inb(EC_LPC_ADDR_HOST_DATA); msg->result = inb(EC_LPC_ADDR_HOST_DATA);
ret = cros_ec_check_result(ec, msg);
switch (msg->result) { if (ret)
case EC_RES_SUCCESS:
break;
case EC_RES_IN_PROGRESS:
ret = -EAGAIN;
dev_dbg(ec->dev, "command 0x%02x in progress\n",
msg->command);
goto done; goto done;
default:
dev_dbg(ec->dev, "command 0x%02x returned %d\n",
msg->command, msg->result);
}
/* Read back args */ /* Read back args */
args.flags = inb(EC_LPC_ADDR_HOST_ARGS); args.flags = inb(EC_LPC_ADDR_HOST_ARGS);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment