diff options
-rw-r--r-- | util/comm-dev.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/util/comm-dev.c b/util/comm-dev.c index 89b1cd9069..a9c2157d64 100644 --- a/util/comm-dev.c +++ b/util/comm-dev.c @@ -49,7 +49,7 @@ static int ec_command_dev(int command, int version, fprintf(stderr, "EC result %d\n", s_cmd.result); } - return r ? r : s_cmd.insize; + return r; } static int ec_readmem_dev(int offset, int bytes, void *dest) @@ -108,9 +108,13 @@ int comm_init_dev(void) /* * TODO: need a way to get this from the driver and EC. For now, - * pick a magic lowest common denominator value. + * pick a magic lowest common denominator value. The ec_max_outsize + * is set to handle v3 EC protocol. The ec_max_insize needs to be + * set to the largest value that can be returned from the EC, + * EC_PROTO2_MAX_PARAM_SIZE. */ - ec_max_insize = ec_max_outsize = EC_PROTO2_MAX_PARAM_SIZE - 8; + ec_max_outsize = EC_PROTO2_MAX_PARAM_SIZE - 8; + ec_max_insize = EC_PROTO2_MAX_PARAM_SIZE; return 0; } |