serial: 8250_dw: Decouple DLF register check from UCV
authorVamshi Gajjela <vamshigajjela@google.com>
Sun, 26 Nov 2023 16:04:20 +0000 (21:34 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 19:24:14 +0000 (19:24 +0000)
commitd804987153e7bedf503f8e4ba649afe52cfd7f6d
tree13ac419317b50dd92e7159797b9f9caaca741585
parent068ab2135b3fe0d8957f099a5b860117457825ec
serial: 8250_dw: Decouple DLF register check from UCV

Designware UART has an optional feature to enable Fractional Baud Rate
Divisor (DLF) through the FRACTIONAL_BAUD_DIVISOR_EN configuration
parameter, and it is not dependent on ADDITIONAL_FEATURES.

dw8250_setup_port() checks DLF to determine dlf_size only when UART
Component Version (UCV) is non-zero. As mentioned above DLF and UCV are
independent features. Move the logic corresponding to DLF size
calculation ahead of the UCV check to prevent early return. Otherwise,
dlf_size will be zero and driver will not be able to use the
controller's fractional baud rate divisor (DLF) feature.

Signed-off-by: Vamshi Gajjela <vamshigajjela@google.com>
Link: https://lore.kernel.org/r/20231126160420.2442330-1-vamshigajjela@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_dwlib.c