Skip to content

Commit bd4e976

Browse files
a-waigregkh
authored andcommitted
tcpm: allow looking for role_sw device in the main node
commit 1366cd2 upstream. If ports are defined in the tcpc main node, fwnode_usb_role_switch_get() returns an error, meaning usb_role_switch_get() (which would succeed) never gets a chance to run as port->role_sw isn't NULL, causing a regression on devices where this is the case. Fix this by turning the NULL check into IS_ERR_OR_NULL(), so usb_role_switch_get() can actually run and the device get properly probed. Fixes: 2d8713f ("tcpm: switch check for role_sw device with fw_node") Cc: stable <stable@kernel.org> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Dragan Simic <dsimic@manjaro.org> Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com> Link: https://patch.msgid.link/20260105-fix-ppp-power-v2-1-6924f5a41224@collabora.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 51afd13 commit bd4e976

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
@@ -7877,7 +7877,7 @@ struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc)
78777877
port->partner_desc.identity = &port->partner_ident;
78787878

78797879
port->role_sw = fwnode_usb_role_switch_get(tcpc->fwnode);
7880-
if (!port->role_sw)
7880+
if (IS_ERR_OR_NULL(port->role_sw))
78817881
port->role_sw = usb_role_switch_get(port->dev);
78827882
if (IS_ERR(port->role_sw)) {
78837883
err = PTR_ERR(port->role_sw);

0 commit comments

Comments
 (0)