mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
serial: sc16is7xx: replace hardcoded divisor value with BIT() macro
[ Upstream commit 2e57cefc4477659527f7adab1f87cdbf60ef1ae6 ] To better show why the limit is what it is, since we have only 16 bits for the divisor. Reviewed-by: Andy Shevchenko <[email protected]> Suggested-by: Andy Shevchenko <[email protected]> Signed-off-by: Hugo Villeneuve <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Stable-dep-of: 8492bd91aa05 ("serial: sc16is7xx: fix bug in sc16is7xx_set_baud() when using prescaler") Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
63127374c8
commit
0876b726c8
1 changed files with 1 additions and 1 deletions
|
|
@ -496,7 +496,7 @@ static int sc16is7xx_set_baud(struct uart_port *port, int baud)
|
|||
u8 prescaler = 0;
|
||||
unsigned long clk = port->uartclk, div = clk / 16 / baud;
|
||||
|
||||
if (div > 0xffff) {
|
||||
if (div >= BIT(16)) {
|
||||
prescaler = SC16IS7XX_MCR_CLKSEL_BIT;
|
||||
div /= 4;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue