From: Utkarsh Patel Date: Fri, 23 Dec 2022 04:22:46 +0000 (-0800) Subject: thunderbolt: Do not report errors if on-board retimers are found X-Git-Tag: v6.1.8~96 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=16b4b0f8e5a054426dea04b4253d15602220dc1c;p=platform%2Fkernel%2Flinux-starfive.git thunderbolt: Do not report errors if on-board retimers are found commit c28f3d80383571d3630df1a0e89500d23e855924 upstream. 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 Signed-off-by: Mika Westerberg Signed-off-by: Greg Kroah-Hartman --- 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++) {