Skip to content

Commit 0f7bbef

Browse files
mgrzeschikgregkh
authored andcommitted
usb: typec: mux: do not return on EOPNOTSUPP in {mux, switch}_set
Since the typec connectors can have many muxes or switches for different lanes (sbu, usb2, usb3) going into different modal states (usb2, usb3, audio, debug) all of them will be called on typec_switch_set and typec_mux_set. But not all of them will be handling the expected mode. If one of the mux or switch will come back with EOPTNOSUPP this is no reason to stop running through the next ones. Therefor we skip this particular error value and continue calling the next. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20250404-ml-topic-typec-mux-v1-1-22c0526381ba@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ac573b9 commit 0f7bbef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/typec/mux.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ int typec_switch_set(struct typec_switch *sw,
214214
sw_dev = sw->sw_devs[i];
215215

216216
ret = sw_dev->set(sw_dev, orientation);
217-
if (ret)
217+
if (ret && ret != -EOPNOTSUPP)
218218
return ret;
219219
}
220220

@@ -378,7 +378,7 @@ int typec_mux_set(struct typec_mux *mux, struct typec_mux_state *state)
378378
mux_dev = mux->mux_devs[i];
379379

380380
ret = mux_dev->set(mux_dev, state);
381-
if (ret)
381+
if (ret && ret != -EOPNOTSUPP)
382382
return ret;
383383
}
384384

0 commit comments

Comments
 (0)