提交 46dacba8 编写于 作者: A Andy Shevchenko 提交者: Greg Kroah-Hartman

serial: 8250_pericom: Use serial_dl_write() instead of open coded

It's better to stick with standard API to write and read DL value
when the hardware is compatible with it. In case any quirks are
needed it may be easily added in one place rather than modifying
code here and there.
Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20211122133512.8947-4-andriy.shevchenko@linux.intel.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 b4ccaf5a
...@@ -70,11 +70,11 @@ static void pericom_do_set_divisor(struct uart_port *port, unsigned int baud, ...@@ -70,11 +70,11 @@ static void pericom_do_set_divisor(struct uart_port *port, unsigned int baud,
/* Update delta due to possible divisor change */ /* Update delta due to possible divisor change */
delta = maxrate / divisor - baud; delta = maxrate / divisor - baud;
if (abs(delta) < baud / 50) { if (abs(delta) < baud / 50) {
struct uart_8250_port *up = up_to_u8250p(port);
int lcr = serial_port_in(port, UART_LCR); int lcr = serial_port_in(port, UART_LCR);
serial_port_out(port, UART_LCR, lcr | 0x80); serial_port_out(port, UART_LCR, lcr | 0x80);
serial_port_out(port, UART_DLL, divisor & 0xff); serial_dl_write(up, divisor);
serial_port_out(port, UART_DLM, (divisor >> 8) & 0xff);
serial_port_out(port, 2, 16 - scr); serial_port_out(port, 2, 16 - scr);
serial_port_out(port, UART_LCR, lcr); serial_port_out(port, UART_LCR, lcr);
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册