Skip to content

Commit e9e6a08

Browse files
Michael Grzeschikopsiff
authored andcommitted
tcpm: switch check for role_sw device with fw_node
commit 2d8713f upstream. When there is no port entry in the tcpci entry itself, the driver will trigger an error message "OF: graph: no port node found in /...../typec" . It is documented that the dts node should contain an connector entry with ports and several port pointing to devices with usb-role-switch property set. Only when those connector entry is missing, it should check for port entries in the main node. We switch the search order for looking after ports, which will avoid the failure message while there are explicit connector entries. Fixes: d56de8c ("usb: typec: tcpm: try to get role switch from tcpc fwnode") Cc: stable <stable@kernel.org> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Badhri Jagan Sridharan <badhri@google.com> Link: https://patch.msgid.link/20251013-b4-ml-topic-tcpm-v2-1-63c9b2ab8a0b@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 91b2d5fcde526ab2c6ce554a93eef23b31c4de70) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent 0f0c5dd commit e9e6a08

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/usb/typec/tcpm/tcpm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6636,9 +6636,9 @@ struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc)
66366636
port->partner_desc.identity = &port->partner_ident;
66376637
port->port_type = port->typec_caps.type;
66386638

6639-
port->role_sw = usb_role_switch_get(port->dev);
6639+
port->role_sw = fwnode_usb_role_switch_get(tcpc->fwnode);
66406640
if (!port->role_sw)
6641-
port->role_sw = fwnode_usb_role_switch_get(tcpc->fwnode);
6641+
port->role_sw = usb_role_switch_get(port->dev);
66426642
if (IS_ERR(port->role_sw)) {
66436643
err = PTR_ERR(port->role_sw);
66446644
goto out_destroy_wq;

0 commit comments

Comments
 (0)