[PATCH v2] thunderbolt: Do not report errors if on-board retimers are found

Utkarsh Patel posted 1 patch 2 years, 8 months ago
drivers/thunderbolt/retimer.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
[PATCH v2] thunderbolt: Do not report errors if on-board retimers are found
Posted by Utkarsh Patel 2 years, 8 months ago
tb_retimer_scan() returns error even when on-board retimers are found.

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>
---
Changes in V2:
1. Removed extra line between the Fixes tag and signed-off.
2. Added the tag for stable tree.
---

 drivers/thunderbolt/retimer.c | 5 ++---
 1 file 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++) {
-- 
2.25.1
Re: [PATCH v2] thunderbolt: Do not report errors if on-board retimers are found
Posted by Mika Westerberg 2 years, 8 months ago
On Thu, Dec 22, 2022 at 08:22:46PM -0800, Utkarsh Patel wrote:
> tb_retimer_scan() returns error even when on-board retimers are found.
> 
> 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>

Applied now, thanks!