On Tue, Dec 26, 2023 at 12:36:47PM +0100, Christoph Niedermaier wrote: > There are register accesses in the function imx_uart_rs485_config(). The > clock must be enabled for these accesses. This was ensured by calling it > via the function uart_rs485_config() in the probe() function within the > range where the clock is enabled. With the commit 7c7f9bc986e6 ("serial: > Deassert Transmit Enable on probe in driver-specific way") it was removed > from the probe() function and is now only called through the function > uart_add_one_port() which is located at the end of the probe() function. > But the clock is already switched off in this area. To ensure that the > clock is enabled during register access, move the disabling of the clock > to the very end of the probe() function. To avoid leaking enabled clocks > on error also add an error path for exiting with disabling the clock. > > Fixes: 7c7f9bc986e6 ("serial: Deassert Transmit Enable on probe in driver-specific way") > Signed-off-by: Christoph Niedermaier <cniedermaier@xxxxxxxxxxxxxxxxxx> Reviewed-by: Lukas Wunner <lukas@xxxxxxxxx>