summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorAlexandre TORGUE <alexandre.torgue@st.com>2016-09-15 18:42:38 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-22 11:48:55 +0200
commit511c7b1baa8ae86dbcf83b8f489d39ff4b64a123 (patch)
tree6f4e3e0dea44cc24512ac6e2f45eea503c0c0458 /drivers/tty
parent59bed2dfe03e9e572bfb5a2d29effc1791eedcbc (diff)
downloadlwn-511c7b1baa8ae86dbcf83b8f489d39ff4b64a123.tar.gz
lwn-511c7b1baa8ae86dbcf83b8f489d39ff4b64a123.zip
serial: stm32: clock disabling management
Keep the clock enabled at the end of stm32_init_port but disable it in stm32_serial_remove. Note that stm32_pm function is there to manage the clock at runtime. Signed-off-by: Gerald Baeza <gerald.baeza@st.com> Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/stm32-usart.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index ab294b927b67..520e7defc08d 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -487,8 +487,6 @@ static int stm32_init_port(struct stm32_port *stm32port,
if (!stm32port->port.uartclk)
ret = -EINVAL;
- clk_disable_unprepare(stm32port->clk);
-
return ret;
}
@@ -557,6 +555,9 @@ static int stm32_serial_probe(struct platform_device *pdev)
static int stm32_serial_remove(struct platform_device *pdev)
{
struct uart_port *port = platform_get_drvdata(pdev);
+ struct stm32_port *stm32_port = to_stm32_port(port);
+
+ clk_disable_unprepare(stm32_port->clk);
return uart_remove_one_port(&stm32_usart_driver, port);
}