diff options
author | Erwan Le Ray <erwan.leray@foss.st.com> | 2021-01-06 17:22:02 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-07 16:19:29 +0100 |
commit | 97f3a0850ae42f29a4d19105274f19ceb2902313 (patch) | |
tree | 34f3b3249048c0de7ad68accfd69f69b61b99a3c /drivers/tty/serial/stm32-usart.c | |
parent | serial: stm32: update conflicting RTS/CTS config comment (diff) | |
download | linux-97f3a0850ae42f29a4d19105274f19ceb2902313.tar.xz linux-97f3a0850ae42f29a4d19105274f19ceb2902313.zip |
serial: stm32: clean probe and remove port deinit
Clean probe and remove port deinit by moving clk_disable_unprepare in a
new dedicated deinit_port function.
Signed-off-by: Erwan Le Ray <erwan.leray@foss.st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
Link: https://lore.kernel.org/r/20210106162203.28854-8-erwan.leray@foss.st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/tty/serial/stm32-usart.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 0d6c7f3375f0..9d73f6976586 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -970,6 +970,11 @@ static const struct uart_ops stm32_uart_ops = { .verify_port = stm32_usart_verify_port, }; +static void stm32_usart_deinit_port(struct stm32_port *stm32port) +{ + clk_disable_unprepare(stm32port->clk); +} + static int stm32_usart_init_port(struct stm32_port *stm32port, struct platform_device *pdev) { @@ -1279,7 +1284,7 @@ err_nowup: device_init_wakeup(&pdev->dev, false); err_uninit: - clk_disable_unprepare(stm32port->clk); + stm32_usart_deinit_port(stm32port); return ret; } @@ -1318,7 +1323,7 @@ static int stm32_usart_serial_remove(struct platform_device *pdev) device_init_wakeup(&pdev->dev, false); } - clk_disable_unprepare(stm32_port->clk); + stm32_usart_deinit_port(stm32_port); err = uart_remove_one_port(&stm32_usart_driver, port); |