diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 788eb05a193c..a088c6e91e37 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -6059,6 +6059,13 @@ static int tcpm_fw_get_caps(struct tcpm_port *port, if (!fwnode) return -EINVAL; + ret = fwnode_property_read_u32(fwnode, "pd-revision", + &pd_revision); + if (ret < 0) + port->typec_caps.pd_revision = 0x0300; + else + port->typec_caps.pd_revision = pd_revision & 0xffff; + /* USB data support is optional */ ret = fwnode_property_read_string(fwnode, "data-role", &cap_str); if (ret == 0) { @@ -6162,13 +6169,6 @@ static int tcpm_fw_get_caps(struct tcpm_port *port, return ret; } - ret = fwnode_property_read_u32(fwnode, "pd-revision", - &pd_revision); - if (ret < 0) - port->typec_caps.pd_revision = 0x0300; - else - port->typec_caps.pd_revision = pd_revision & 0xffff; - return 0; }