Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

serial: tegra: Remove custom frame size calculation

The number of bits can be calculated using tty_get_frame_size(), no
need for the driver to do it on its own.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220830084925.5608-6-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ilpo Järvinen and committed by
Greg Kroah-Hartman
cac8f719 5ec2952c

+3 -9
+3 -9
drivers/tty/serial/serial-tegra.c
··· 1279 1279 unsigned long flags; 1280 1280 unsigned int lcr; 1281 1281 unsigned char char_bits; 1282 - int symb_bit = 1; 1283 1282 struct clk *parent_clk = clk_get_parent(tup->uart_clk); 1284 1283 unsigned long parent_clk_rate = clk_get_rate(parent_clk); 1285 1284 int max_divider = (tup->cdata->support_clk_src_div) ? 0x7FFF : 0xFFFF; ··· 1305 1306 termios->c_cflag &= ~CMSPAR; 1306 1307 1307 1308 if ((termios->c_cflag & PARENB) == PARENB) { 1308 - symb_bit++; 1309 1309 if (termios->c_cflag & PARODD) { 1310 1310 lcr |= UART_LCR_PARITY; 1311 1311 lcr &= ~UART_LCR_EPAR; ··· 1317 1319 } 1318 1320 1319 1321 char_bits = tty_get_char_size(termios->c_cflag); 1320 - symb_bit += char_bits; 1321 1322 lcr &= ~UART_LCR_WLEN8; 1322 1323 lcr |= UART_LCR_WLEN(char_bits); 1323 1324 1324 1325 /* Stop bits */ 1325 - if (termios->c_cflag & CSTOPB) { 1326 + if (termios->c_cflag & CSTOPB) 1326 1327 lcr |= UART_LCR_STOP; 1327 - symb_bit += 2; 1328 - } else { 1328 + else 1329 1329 lcr &= ~UART_LCR_STOP; 1330 - symb_bit++; 1331 - } 1332 1330 1333 1331 tegra_uart_write(tup, lcr, UART_LCR); 1334 1332 tup->lcr_shadow = lcr; 1335 - tup->symb_bit = symb_bit; 1333 + tup->symb_bit = tty_get_frame_size(termios->c_cflag); 1336 1334 1337 1335 /* Baud rate. */ 1338 1336 baud = uart_get_baud_rate(u, termios, oldtermios,