diff options
author | Javier Martinez Canillas <javier.martinez@collabora.co.uk> | 2015-06-22 02:27:18 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2015-10-07 17:34:26 -0400 |
commit | fbf40727c781a3b8562e76a86cd08a111414d1c7 (patch) | |
tree | 8c7fae1b524f198f5d66dc405f654bb3f773a12d | |
parent | 75529a9d427500f1b7deb3d0dec5c8d0a61fee02 (diff) |
platform/chrome: cros_ec_lpc - Use existing function to check EC result
Commit 6db07b633658 ("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: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r-- | drivers/platform/chrome/cros_ec_lpc.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c index bdd77ce45f05..ca7cdc6eef0b 100644 --- a/drivers/platform/chrome/cros_ec_lpc.c +++ b/drivers/platform/chrome/cros_ec_lpc.c | |||
@@ -166,19 +166,9 @@ static int cros_ec_cmd_xfer_lpc(struct cros_ec_device *ec, | |||
166 | 166 | ||
167 | /* Check result */ | 167 | /* Check result */ |
168 | msg->result = inb(EC_LPC_ADDR_HOST_DATA); | 168 | msg->result = inb(EC_LPC_ADDR_HOST_DATA); |
169 | 169 | ret = cros_ec_check_result(ec, msg); | |
170 | switch (msg->result) { | 170 | if (ret) |
171 | case EC_RES_SUCCESS: | ||
172 | break; | ||
173 | case EC_RES_IN_PROGRESS: | ||
174 | ret = -EAGAIN; | ||
175 | dev_dbg(ec->dev, "command 0x%02x in progress\n", | ||
176 | msg->command); | ||
177 | goto done; | 171 | goto done; |
178 | default: | ||
179 | dev_dbg(ec->dev, "command 0x%02x returned %d\n", | ||
180 | msg->command, msg->result); | ||
181 | } | ||
182 | 172 | ||
183 | /* Read back args */ | 173 | /* Read back args */ |
184 | args.flags = inb(EC_LPC_ADDR_HOST_ARGS); | 174 | args.flags = inb(EC_LPC_ADDR_HOST_ARGS); |