Thread (3 messages) 3 messages, 1 author, 2021-07-13
STALE1803d LANDED
Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

[PATCH v2 1/2] tty: serial: uartlite: Disable clocks in case of errors

From: Shubhrajyoti Datta <hidden>
Date: 2021-07-13 06:48:48
Subsystem: the rest, tty layer and serial drivers, xilinx uartlite serial driver · Maintainers: Linus Torvalds, Greg Kroah-Hartman, Jiri Slaby, Peter Korsgaard

In case the uart registration fails the clocks are left enabled.
Disable the clock in case of errors.

Signed-off-by: Shubhrajyoti Datta <redacted>
---
v2:
remove the go to

 drivers/tty/serial/uartlite.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
index f42ccc40ffa6..fd7a2f82c885 100644
--- a/drivers/tty/serial/uartlite.c
+++ b/drivers/tty/serial/uartlite.c
@@ -799,6 +799,7 @@ static int ulite_probe(struct platform_device *pdev)
 		ret = uart_register_driver(&ulite_uart_driver);
 		if (ret < 0) {
 			dev_err(&pdev->dev, "Failed to register driver\n");
+			clk_disable_unprepare(pdata->clk);
 			return ret;
 		}
 	}
-- 
2.17.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help