[PATCH 18/18] drivers/serial: imx: add required clock preparation

Philippe Gerum rpm at xenomai.org
Mon Feb 4 11:56:47 CET 2019


---
 kernel/drivers/serial/rt_imx_uart.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/drivers/serial/rt_imx_uart.c b/kernel/drivers/serial/rt_imx_uart.c
index 1aec219b7..443a34261 100644
--- a/kernel/drivers/serial/rt_imx_uart.c
+++ b/kernel/drivers/serial/rt_imx_uart.c
@@ -1579,8 +1579,8 @@ static int rt_imx_uart_probe(struct platform_device *pdev)
 	if (IS_ERR(port->clk_per))
 		return PTR_ERR(port->clk_per);
 
-	clk_enable(port->clk_ipg);
-	clk_enable(port->clk_per);
+	clk_prepare_enable(port->clk_ipg);
+	clk_prepare_enable(port->clk_per);
 	port->uartclk = clk_get_rate(port->clk_per);
 
 	port->use_hwflow = 1;
@@ -1605,6 +1605,8 @@ static int rt_imx_uart_remove(struct platform_device *pdev)
 	pdata = pdev->dev.platform_data;
 	platform_set_drvdata(pdev, NULL);
 
+	clk_disable_unprepare(port->clk_ipg);
+	clk_disable_unprepare(port->clk_per);
 	rtdm_dev_unregister(dev);
 
 	return 0;
-- 
2.17.2




More information about the Xenomai mailing list