summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt/retimer.c
diff options
context:
space:
mode:
authorUtkarsh Patel <utkarsh.h.patel@intel.com>2022-12-23 07:22:46 +0300
committerMika Westerberg <mika.westerberg@linux.intel.com>2022-12-27 11:39:52 +0300
commitc28f3d80383571d3630df1a0e89500d23e855924 (patch)
treee1397af9884e6304cf56376de14e98be44fae952 /drivers/thunderbolt/retimer.c
parent1b929c02afd37871d5afb9d498426f83432e71c2 (diff)
downloadlinux-c28f3d80383571d3630df1a0e89500d23e855924.tar.xz
thunderbolt: Do not report errors if on-board retimers are found
Currently we return an error even if on-board retimers are found and that's not expected. Fix this to return an error only if there was one and 0 otherwise. Fixes: 1e56c88adecc ("thunderbolt: Runtime resume USB4 port when retimers are scanned") Cc: stable@vger.kernel.org Signed-off-by: Utkarsh Patel <utkarsh.h.patel@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/retimer.c')
-rw-r--r--drivers/thunderbolt/retimer.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/thunderbolt/retimer.c b/drivers/thunderbolt/retimer.c
index 81252e31014a..6ebe7a2886ec 100644
--- a/drivers/thunderbolt/retimer.c
+++ b/drivers/thunderbolt/retimer.c
@@ -471,10 +471,9 @@ int tb_retimer_scan(struct tb_port *port, bool add)
break;
}
- if (!last_idx) {
- ret = 0;
+ ret = 0;
+ if (!last_idx)
goto out;
- }
/* Add on-board retimers if they do not exist already */
for (i = 1; i <= last_idx; i++) {