summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/cros_ec.c4
-rw-r--r--drivers/misc/cros_ec_sandbox.c10
2 files changed, 8 insertions, 6 deletions
diff --git a/drivers/misc/cros_ec.c b/drivers/misc/cros_ec.c
index 2dcdb3d8d61..565de040fe9 100644
--- a/drivers/misc/cros_ec.c
+++ b/drivers/misc/cros_ec.c
@@ -420,7 +420,7 @@ int cros_ec_read_id(struct udevice *dev, char *id, int maxlen)
ret = ec_command_inptr(dev, EC_CMD_GET_VERSION, 0, NULL, 0,
(uint8_t **)&r, sizeof(*r));
if (ret != sizeof(*r)) {
- log_err("Got rc %d, expected %d\n", ret, sizeof(*r));
+ log_err("Got rc %d, expected %u\n", ret, (uint)sizeof(*r));
return -1;
}
@@ -1466,7 +1466,7 @@ int cros_ec_set_lid_shutdown_mask(struct udevice *dev, int enable)
if (ret < 0)
return ret;
- // Set lid close event state in the EC SMI event mask
+ /* Set lid close event state in the EC SMI event mask */
if (enable)
mask |= EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_CLOSED);
else
diff --git a/drivers/misc/cros_ec_sandbox.c b/drivers/misc/cros_ec_sandbox.c
index 429f1a9b269..4fcb2d96f51 100644
--- a/drivers/misc/cros_ec_sandbox.c
+++ b/drivers/misc/cros_ec_sandbox.c
@@ -313,13 +313,15 @@ static int process_cmd(struct ec_state *ec,
switch (req->op) {
case EC_VBNV_CONTEXT_OP_READ:
+ /* TODO(sjg@chromium.org): Support full-size context */
memcpy(resp->block, ec->vbnv_context,
- sizeof(resp->block));
- len = sizeof(*resp);
+ EC_VBNV_BLOCK_SIZE);
+ len = 16;
break;
case EC_VBNV_CONTEXT_OP_WRITE:
- memcpy(ec->vbnv_context, resp->block,
- sizeof(resp->block));
+ /* TODO(sjg@chromium.org): Support full-size context */
+ memcpy(ec->vbnv_context, req->block,
+ EC_VBNV_BLOCK_SIZE);
len = 0;
break;
default: