OSDN Git Service

serial: cpm_uart: Deduplicate cpm_set_{brg/smc_fcr/scc_fcr}()
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Thu, 3 Aug 2023 13:56:46 +0000 (15:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Aug 2023 13:08:30 +0000 (15:08 +0200)
commit647f5a00d3060297fcfcd0edb026594b313aefed
treebbb91689e043591fa9fe13cee0b911a5850ba72e
parentc2d6c1b4f0349a5d93ebbd8d5311fbbaf1fa54dd
serial: cpm_uart: Deduplicate cpm_set_{brg/smc_fcr/scc_fcr}()

CPMFCR_EB is the same as SMC_EB and is defined
for both CPM1 and CPM2.

CPMFCR_GBL is defined as 0 for CPM1.

Therefore the CPM2 version of cpm_set_scc_fcr() and
cpm_set_smc_fcr() can be used on both CPM1 and CPM2.

And cpm_set_brg() is already identical and just a
wrapper of cpm_setbrg().

In addition those three fonctions are only called once
from cpm_uart_core.c, so just replace the calls with
the content of the CPM2 versions of them.

And DPRAM_BASE is identical so can go in cpm_uart.h. While
moving it, use cpm_muram_addr() directly instead of the
cpm_dpram_addr() macro and remove __force tag which isn't needed.

Then cpm_uart_cpm1.h and cpm_uart_cpm2.h go away.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/6920e61fd362961ae1aeda897c8bfe1efacdc9dc.1691068700.git.christophe.leroy@csgroup.eu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/cpm_uart/cpm_uart.h
drivers/tty/serial/cpm_uart/cpm_uart_core.c
drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h [deleted file]
drivers/tty/serial/cpm_uart/cpm_uart_cpm2.h [deleted file]