Skip to content

Commit 6b275bf

Browse files
Xu Yanggregkh
authored andcommitted
Revert "tcpm: allow looking for role_sw device in the main node"
This reverts commit 1366cd2. The fwnode_usb_role_switch_get() returns NULL only if no connection is found, returns ERR_PTR(-EPROBE_DEFER) if connection is found but deferred probe is needed, or a valid pointer of usb_role_switch. When switching from a NULL check to IS_ERR_OR_NULL(), usb_role_switch_get() returns NULL and overwrites the ERR_PTR(-EPROBE_DEFER) returned by fwnode_usb_role_switch_get(). This causes the deferred probe indication to be lost, preventing the USB role switch from ever being retrieved. Fixes: 1366cd2 ("tcpm: allow looking for role_sw device in the main node") Cc: stable <stable@kernel.org> Signed-off-by: Xu Yang <xu.yang_2@nxp.com> Tested-by: Arnaud Ferraris <arnaud.ferraris@collabora.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://patch.msgid.link/20260309074313.2809867-2-xu.yang_2@nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ec35c19 commit 6b275bf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/usb/typec/tcpm/tcpm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7890,7 +7890,7 @@ struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc)
78907890
port->partner_desc.identity = &port->partner_ident;
78917891

78927892
port->role_sw = fwnode_usb_role_switch_get(tcpc->fwnode);
7893-
if (IS_ERR_OR_NULL(port->role_sw))
7893+
if (!port->role_sw)
78947894
port->role_sw = usb_role_switch_get(port->dev);
78957895
if (IS_ERR(port->role_sw)) {
78967896
err = PTR_ERR(port->role_sw);

0 commit comments

Comments
 (0)