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

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>

authored by

Michael Grzeschik and committed by
Greg Kroah-Hartman
0f7bbef1 ac573b94

+2 -2
+2 -2
drivers/usb/typec/mux.c
··· 214 214 sw_dev = sw->sw_devs[i]; 215 215 216 216 ret = sw_dev->set(sw_dev, orientation); 217 - if (ret) 217 + if (ret && ret != -EOPNOTSUPP) 218 218 return ret; 219 219 } 220 220 ··· 378 378 mux_dev = mux->mux_devs[i]; 379 379 380 380 ret = mux_dev->set(mux_dev, state); 381 - if (ret) 381 + if (ret && ret != -EOPNOTSUPP) 382 382 return ret; 383 383 } 384 384