diff mbox series

[04/13] thunderbolt: Check for unplugged router in tb_switch_clx_disable()

Message ID 20231003094005.2676823-5-mika.westerberg@linux.intel.com (mailing list archive)
State Accepted
Commit 9e4f5b2af24297552017dd3d4db2379779701b6f
Headers show
Series thunderbolt: DisplayPort and logging improvements & cleanups | expand

Commit Message

Mika Westerberg Oct. 3, 2023, 9:39 a.m. UTC
There is no point disabling CL states if the router is unplugged so in
that case return early.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/thunderbolt/clx.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/thunderbolt/clx.c b/drivers/thunderbolt/clx.c
index c08b9cf0371e..787dfd1550e5 100644
--- a/drivers/thunderbolt/clx.c
+++ b/drivers/thunderbolt/clx.c
@@ -405,6 +405,9 @@  int tb_switch_clx_disable(struct tb_switch *sw)
 	if (!clx)
 		return 0;
 
+	if (sw->is_unplugged)
+		return clx;
+
 	up = tb_upstream_port(sw);
 	down = tb_switch_downstream_port(sw);