From 841977df21e5f2c1276ae5a33cca3ac4fb976ad9 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Fri, 11 Jul 2014 20:29:02 +0900 Subject: [PATCH] serial: ns16550: drop CONFIG_OMAP1610 from the special case If CONFIG_OMAP1610 is defined, the code returning the fixed value (26) is enabled. But this case is covered by the following code. (CONFIG_SYS_NS16550_CLK + (gd->baudrate * (MODE_X_DIV / 2))) / (MODE_X_DIV * gd->baudrate) = (48000000 + (115200 * (16 / 2))) / (16 * 115200) = 48921600 / 1843200 = 26 The "#ifdef CONFIG_OMAP1610" was added by commit 6f21347d more than ten years ago. In those days, the divide-and-round was not used. I guess that is why this weird code was added here. Signed-off-by: Masahiro Yamada Cc: Tom Rini Cc: Rishi Bhattacharya --- drivers/serial/serial_ns16550.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c index ba68d46948..056ef2a9a1 100644 --- a/drivers/serial/serial_ns16550.c +++ b/drivers/serial/serial_ns16550.c @@ -128,12 +128,6 @@ static int calc_divisor (NS16550_t port) } port->osc_12m_sel = 0; /* clear if previsouly set */ #endif -#ifdef CONFIG_OMAP1610 - /* If can't cleanly clock 115200 set div to 1 */ - if ((CONFIG_SYS_NS16550_CLK == 48000000) && (gd->baudrate == 115200)) { - return (26); /* return 26 for base divisor */ - } -#endif #define MODE_X_DIV 16 /* Compute divisor value. Normally, we should simply return: -- 2.39.2