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 <caveh@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69370
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c
index 3afe840..01f9ff4 100644
--- a/src/ec/google/chromeec/ec.c
+++ b/src/ec/google/chromeec/ec.c
@@ -1378,7 +1378,7 @@
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 @@
if (rv)
return rv;
- *num_ports = resp.port_count;
+ *num_ports = resp.num_ports;
return 0;
}