Skip to content

Commit e6210ff

Browse files
mgrzeschikgregkh
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 <[email protected]> Signed-off-by: Michael Grzeschik <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Reviewed-by: Badhri Jagan Sridharan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7d851f7 commit e6210ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/typec/tcpm/tcpm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7696,9 +7696,9 @@ struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc)
76967696

76977697
port->partner_desc.identity = &port->partner_ident;
76987698

7699-
port->role_sw = usb_role_switch_get(port->dev);
7699+
port->role_sw = fwnode_usb_role_switch_get(tcpc->fwnode);
77007700
if (!port->role_sw)
7701-
port->role_sw = fwnode_usb_role_switch_get(tcpc->fwnode);
7701+
port->role_sw = usb_role_switch_get(port->dev);
77027702
if (IS_ERR(port->role_sw)) {
77037703
err = PTR_ERR(port->role_sw);
77047704
goto out_destroy_wq;

0 commit comments

Comments
 (0)