Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tcpm: switch check for role_sw device with fw_node

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: d56de8c9a17d ("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>

authored by

Michael Grzeschik and committed by
Greg Kroah-Hartman
2d8713f8 dfc2cf4d

+2 -2
+2 -2
drivers/usb/typec/tcpm/tcpm.c
··· 7876 7876 7877 7877 port->partner_desc.identity = &port->partner_ident; 7878 7878 7879 - port->role_sw = usb_role_switch_get(port->dev); 7879 + port->role_sw = fwnode_usb_role_switch_get(tcpc->fwnode); 7880 7880 if (!port->role_sw) 7881 - port->role_sw = fwnode_usb_role_switch_get(tcpc->fwnode); 7881 + port->role_sw = usb_role_switch_get(port->dev); 7882 7882 if (IS_ERR(port->role_sw)) { 7883 7883 err = PTR_ERR(port->role_sw); 7884 7884 goto out_destroy_wq;