lkml.org 
[lkml]   [2016]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 04/10] serial: mps2-uart: add MPS2 UART driver
On 16/02/16 11:02, One Thousand Gnomes wrote:
>
>> +static void mps2_uart_set_termios(struct uart_port *port,
>> + struct ktermios *new, struct ktermios *old)
>
> Not that I care much but you might not want to call it "new". People get
> upset when their syntax aware editors get confused by C++ keywords 8)

Just renamed it to have cpp suffix and looks like my editor falls under
that category :)

>
>> +{
>> + unsigned long flags;
>> + unsigned int baud, bauddiv;
>> +
>> + new->c_cflag &= ~(CRTSCTS | CMSPAR);
>> + new->c_cflag &= ~CSIZE;
>> + new->c_cflag |= CS8;
>> + new->c_cflag &= ~PARENB;
>> + new->c_cflag &= ~CSTOPB;
>> +
>> + baud = uart_get_baud_rate(port, new, old,
>> + DIV_ROUND_CLOSEST(port->uartclk, UARTn_BAUDDIV_MASK),
>> + DIV_ROUND_CLOSEST(port->uartclk, 16));
>> +
>> + bauddiv = DIV_ROUND_CLOSEST(port->uartclk, baud);
>> +
>> + spin_lock_irqsave(&port->lock, flags);
>> +
>> + uart_update_timeout(port, new->c_cflag, baud);
>> + mps2_uart_write32(port, bauddiv, UARTn_BAUDDIV);
>
> This should also set the baud bits back in the termios struct
> accordingly.
>
> if (tty_termios_baud_rate(new))
> tty_termios_encode_baud_rate(new, baud, baud);
>
>
> Not a big deal and could certainly be a follow up patch after it's merged.

I'll fold it in the next version.

Thanks
Vladimir

>
> Alan
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
>
>

\
 
 \ /
  Last update: 2016-02-16 16:41    [W:0.176 / U:0.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site