summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-05-26 13:35:01 -0700
committerGerrit <chrome-bot@google.com>2012-07-02 20:36:57 -0700
commite723318ec139e6729e4f2aa20cdde32f04960922 (patch)
treea53b5457938fc733f3ffdb085a936bf150326009 /common
parented9d6282d46d8216ae6f81477171324fcbdc94aa (diff)
downloadchrome-ec-e723318ec139e6729e4f2aa20cdde32f04960922.tar.gz
Remove unnecessary host_send_result()
This seems to be a hangover from the LPC protocol. We can send a result just by sending a response with no data. Drop this function and remove all uses of it. Also use 'enum ec_status' instead of int, since this is the correct response type. BUG=chrome-os-partner:10533 TEST=manual: build for all boards build and boot on daisy Change-Id: I93a029bd6ba8cec567b61af3b410bcead015b5c0 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/25980
Diffstat (limited to 'common')
-rw-r--r--common/host_command.c10
-rw-r--r--common/system_common.c6
2 files changed, 7 insertions, 9 deletions
diff --git a/common/host_command.c b/common/host_command.c
index 93e66b68ad..4de9f36404 100644
--- a/common/host_command.c
+++ b/common/host_command.c
@@ -34,7 +34,7 @@ void host_command_received(int slot, int command)
if (command == EC_CMD_REBOOT) {
system_reset(1);
/* Reset should never return; if it does, post an error */
- host_send_result(slot, EC_RES_ERROR);
+ host_send_response(slot, EC_RES_ERROR, NULL, 0);
return;
}
@@ -144,12 +144,10 @@ static void command_process(int slot)
if (cmd) {
int size = 0;
int res = cmd->handler(data, &size);
- if ((res == EC_RES_SUCCESS) && size)
- host_send_response(slot, data, size);
- else
- host_send_result(slot, res);
+
+ host_send_response(slot, res, data, size);
} else {
- host_send_result(slot, EC_RES_INVALID_COMMAND);
+ host_send_response(slot, EC_RES_INVALID_COMMAND, data, 0);
}
}
diff --git a/common/system_common.c b/common/system_common.c
index 353068365f..f4cb3f1755 100644
--- a/common/system_common.c
+++ b/common/system_common.c
@@ -741,10 +741,10 @@ int host_command_reboot(uint8_t *data, int *resp_size)
#ifdef CONFIG_TASK_HOSTCMD
#ifdef CONFIG_LPC
/* Clean busy bits on host */
- host_send_result(0, EC_RES_SUCCESS);
- host_send_result(1, EC_RES_SUCCESS);
+ host_send_response(0, EC_RES_SUCCESS, NULL, 0);
+ host_send_response(1, EC_RES_SUCCESS, NULL, 0);
#elif defined CONFIG_I2C
- host_send_result(0, EC_RES_SUCCESS);
+ host_send_response(0, EC_RES_SUCCESS, NULL, 0);
#endif
#endif