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>
        if (!stm32port->port.uartclk)
                ret = -EINVAL;
 
-       clk_disable_unprepare(stm32port->clk);
-
        return ret;
 }
 
 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);
 }