diff options
-rw-r--r-- | util/comm-dev.c | 1 | ||||
-rw-r--r-- | util/comm-host.h | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/util/comm-dev.c b/util/comm-dev.c index a9c2157d64..1175f92555 100644 --- a/util/comm-dev.c +++ b/util/comm-dev.c @@ -47,6 +47,7 @@ static int ec_command_dev(int command, int version, } } else if (s_cmd.result != EC_RES_SUCCESS) { fprintf(stderr, "EC result %d\n", s_cmd.result); + return -EECRESULT - s_cmd.result; } return r; diff --git a/util/comm-host.h b/util/comm-host.h index 695fc33c4f..1e01d58e40 100644 --- a/util/comm-host.h +++ b/util/comm-host.h @@ -12,6 +12,9 @@ #include "common.h" #include "ec_commands.h" +/* ec_command return value for non-success result from EC */ +#define EECRESULT 1000 + /* Maximum output and input sizes for EC command, in bytes */ extern int ec_max_outsize, ec_max_insize; |