Commit 97f3a085 authored by Erwan Le Ray's avatar Erwan Le Ray Committed by Greg Kroah-Hartman

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: default avatarErwan Le Ray <erwan.leray@foss.st.com>
Signed-off-by: default avatarEtienne Carriere <etienne.carriere@foss.st.com>
Link: https://lore.kernel.org/r/20210106162203.28854-8-erwan.leray@foss.st.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9359369a
...@@ -970,6 +970,11 @@ static const struct uart_ops stm32_uart_ops = { ...@@ -970,6 +970,11 @@ static const struct uart_ops stm32_uart_ops = {
.verify_port = stm32_usart_verify_port, .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, static int stm32_usart_init_port(struct stm32_port *stm32port,
struct platform_device *pdev) struct platform_device *pdev)
{ {
...@@ -1279,7 +1284,7 @@ static int stm32_usart_serial_probe(struct platform_device *pdev) ...@@ -1279,7 +1284,7 @@ static int stm32_usart_serial_probe(struct platform_device *pdev)
device_init_wakeup(&pdev->dev, false); device_init_wakeup(&pdev->dev, false);
err_uninit: err_uninit:
clk_disable_unprepare(stm32port->clk); stm32_usart_deinit_port(stm32port);
return ret; return ret;
} }
...@@ -1318,7 +1323,7 @@ static int stm32_usart_serial_remove(struct platform_device *pdev) ...@@ -1318,7 +1323,7 @@ static int stm32_usart_serial_remove(struct platform_device *pdev)
device_init_wakeup(&pdev->dev, false); 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); err = uart_remove_one_port(&stm32_usart_driver, port);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment