serial: imx: factor-out common code to imx_uart_soft_reset()
authorSergey Organov <sorganov@gmail.com>
Wed, 1 Feb 2023 14:26:54 +0000 (17:26 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Feb 2023 12:11:48 +0000 (13:11 +0100)
commitd45fb2e430e54fac6af3cabb39c36171c4bf3f52
tree8d82191906391e249ca493904dc8ffb1bc41a4aa
parent8cf31a99d3a53a68f7032452cb7de3203b8200c8
serial: imx: factor-out common code to imx_uart_soft_reset()

We perform soft reset in 2 places, slightly differently for no sufficient
reasons, so move more generic variant to a function, and re-use the code.

Out of 2 repeat counters, 10 and 100, select 10, as the code works at
interrupts disabled, and in practice the reset happens immediately.

Signed-off-by: Sergey Organov <sorganov@gmail.com>
Link: https://lore.kernel.org/r/20230201142700.4346-2-sorganov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c