diff options
author | Caveh Jalali <caveh@chromium.org> | 2023-01-12 22:40:40 -0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-01-18 01:21:01 +0000 |
commit | aaf2c3eadc61067cfabc34ecdb9039527ab0b955 (patch) | |
tree | 94b22413605d1bd4c0d25735f62ace748c1a1772 /common/usb_pd_host_cmd.c | |
parent | 4e444720f5c3dedeef7c56d93233dc1254736151 (diff) | |
download | chrome-ec-aaf2c3eadc61067cfabc34ecdb9039527ab0b955.tar.gz |
common/usb_pd_host_cmd: Fix EC_CMD_USB_PD_DEV_INFO param
The EC_CMD_USB_PD_DEV_INFO host command should be implemented to use a
'struct ec_params_usb_pd_info' as the input parameter instead of a
uint8_t. Callers (ectool, kernel) already pass a 'struct
ec_params_usb_pd_info' for this host command, so it makes sense to "fix"
the implementation. The struct only has a uint8_t member, so no
functional change is introduced.
BRANCH=none
BUG=b:258110734
TEST='./twister -v -T zephyr/test' passes
'make buildall' passes
Change-Id: I8f70496ea4148340971a2c6b29408a0529ec8f3e
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4171495
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'common/usb_pd_host_cmd.c')
-rw-r--r-- | common/usb_pd_host_cmd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/usb_pd_host_cmd.c b/common/usb_pd_host_cmd.c index 020c332d7a..459c700ded 100644 --- a/common/usb_pd_host_cmd.c +++ b/common/usb_pd_host_cmd.c @@ -192,15 +192,15 @@ DECLARE_HOST_COMMAND(EC_CMD_USB_PD_GET_AMODE, hc_remote_pd_get_amode, #ifdef CONFIG_COMMON_RUNTIME static enum ec_status hc_remote_pd_dev_info(struct host_cmd_handler_args *args) { - const uint8_t *port = args->params; + const struct ec_params_usb_pd_info_request *p = args->params; struct ec_params_usb_pd_rw_hash_entry *r = args->response; uint16_t dev_id; uint32_t current_image; - if (*port >= board_get_usb_pd_port_count()) + if (p->port >= board_get_usb_pd_port_count()) return EC_RES_INVALID_PARAM; - pd_dev_get_rw_hash(*port, &dev_id, r->dev_rw_hash, ¤t_image); + pd_dev_get_rw_hash(p->port, &dev_id, r->dev_rw_hash, ¤t_image); r->dev_id = dev_id; r->current_image = current_image; |