Skip to contentSkip to conversation

tty: serial: fsl_lpuart: Use common code in lpuart_global_reset()

PATCH New Markus Elfring 1 participant 1 message Sep 25, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tty: serial: fsl_lpuart: Use common code in lpuart_global_reset()

From: Markus Elfring <[email protected]>
Date: Wed, 25 Sep 2024 16:36:20 +0200

Add a label so that two statements can be better reused at the end of this function implementation.

This issue was detected by using the Coccinelle software.

---
 drivers/tty/serial/fsl_lpuart.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/tty/serial/fsl_lpuart.c +2 -3
index 77efa7ee6eda..b63419c1a4ea 100644
@@ -2811,8 +2811,7 @@ static int lpuart_global_reset(struct lpuart_port *sport)
 					      port)) {
 				dev_warn(sport->port.dev,
 					 "timeout waiting for transmit engine to complete\n");
-				clk_disable_unprepare(sport->ipg_clk);
-				return 0;
+				goto disable_unprepare_clk;
 			}
 		}
 
@@ -2828,7 +2827,7 @@ static int lpuart_global_reset(struct lpuart_port *sport)
 			lpuart32_write(port, ctrl, UARTCTRL);
 		}
 	}
-
+disable_unprepare_clk:
 	clk_disable_unprepare(sport->ipg_clk);
 	return 0;
 }

--
2.46.1