[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160216110217.3de7c007@lxorguk.ukuu.org.uk>
Date: Tue, 16 Feb 2016 11:02:17 +0000
From: One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>
To: Vladimir Murzin <vladimir.murzin@....com>
Cc: arnd@...db.de, linux@....linux.org.uk, gregkh@...uxfoundation.org,
daniel.lezcano@...aro.org, tglx@...utronix.de,
u.kleine-koenig@...gutronix.de, mark.rutland@....com,
pawel.moll@....com, ijc+devicetree@...lion.org.uk,
galak@...eaurora.org, jslaby@...e.cz, robh+dt@...nel.org,
andy.shevchenko@...il.com, devicetree@...r.kernel.org,
linux-serial@...r.kernel.org, linux-api@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 04/10] serial: mps2-uart: add MPS2 UART driver
> +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)
> +{
> + 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.
Alan
Powered by blists - more mailing lists