serial: imx: disable console clocks on unregister
authorFrancesco Dolcini <francesco.dolcini@toradex.com>
Wed, 20 Oct 2021 19:26:43 +0000 (21:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Oct 2021 08:30:08 +0000 (10:30 +0200)
commit9768a37cec37b03f745ce90f8c3d378e0aa223ae
tree0fe9799146f1216deaf50240d51fce1b1017b928
parent6d0d1b5a1b4870911beb89544ec1a9751c42fec7
serial: imx: disable console clocks on unregister

During console setup imx_uart_console_setup() enables clocks, but they
are never disabled when the console is unregistered, this leads to
clk_prepare_enable() being called multiple times without a matching
clk_disable_unprepare() in case of console unregister.

Ensure that clock enable/disable are balanced adding
clk_disable_unprepare() in the console exit callback.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Link: https://lore.kernel.org/r/20211020192643.476895-3-francesco.dolcini@toradex.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c