From 21552aee3f9dbbb5c7bc1417f245a82b0fa8943d Mon Sep 17 00:00:00 2001 From: Caveh Jalali Date: Wed, 2 Nov 2022 18:59:36 -0700 Subject: [PATCH] ec/google/chromeec: Fix USB_PD_PORTS response data type The EC_CMD_USB_PD_PORTS host command returns a struct ec_response_usb_pd_ports, not a struct ec_response_charge_port_count. Luckily, both structs have the same memory layout, so this is simply a name change. BUG=b:258126464 BRANCH=none TEST=none Change-Id: I0d7710ca8a45f0ea3939f58bbba6bab31ff41919 Signed-off-by: Caveh Jalali Reviewed-on: https://review.coreboot.org/c/coreboot/+/69370 Reviewed-by: Daisuke Nojiri Tested-by: build bot (Jenkins) --- src/ec/google/chromeec/ec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index 3afe840d53..01f9ff476b 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -1378,7 +1378,7 @@ enum ec_image google_chromeec_get_current_image(void) int google_chromeec_get_num_pd_ports(unsigned int *num_ports) { - struct ec_response_charge_port_count resp = {}; + struct ec_response_usb_pd_ports resp = {}; struct chromeec_command cmd = { .cmd_code = EC_CMD_USB_PD_PORTS, .cmd_version = 0, @@ -1393,7 +1393,7 @@ int google_chromeec_get_num_pd_ports(unsigned int *num_ports) if (rv) return rv; - *num_ports = resp.port_count; + *num_ports = resp.num_ports; return 0; }