mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
serial: ns16550: use a const variable instead of macro
Just for type checking. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Marek Vasut <marex@denx.de> Acked-by: Marek Vasut <marex@denx.de>
This commit is contained in:
committed by
Tom Rini
parent
f8c7c2033d
commit
5b9587ae31
@@ -120,6 +120,8 @@ static NS16550_t serial_ports[6] = {
|
|||||||
|
|
||||||
static int calc_divisor (NS16550_t port)
|
static int calc_divisor (NS16550_t port)
|
||||||
{
|
{
|
||||||
|
const unsigned int mode_x_div = 16;
|
||||||
|
|
||||||
#ifdef CONFIG_OMAP1510
|
#ifdef CONFIG_OMAP1510
|
||||||
/* If can't cleanly clock 115200 set div to 1 */
|
/* If can't cleanly clock 115200 set div to 1 */
|
||||||
if ((CONFIG_SYS_NS16550_CLK == 12000000) && (gd->baudrate == 115200)) {
|
if ((CONFIG_SYS_NS16550_CLK == 12000000) && (gd->baudrate == 115200)) {
|
||||||
@@ -129,10 +131,8 @@ static int calc_divisor (NS16550_t port)
|
|||||||
port->osc_12m_sel = 0; /* clear if previsouly set */
|
port->osc_12m_sel = 0; /* clear if previsouly set */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MODE_X_DIV 16
|
|
||||||
|
|
||||||
return DIV_ROUND_CLOSEST(CONFIG_SYS_NS16550_CLK,
|
return DIV_ROUND_CLOSEST(CONFIG_SYS_NS16550_CLK,
|
||||||
MODE_X_DIV * gd->baudrate);
|
mode_x_div * gd->baudrate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Reference in New Issue
Block a user