Re: [PATCH] U6715 16550A serial driver support

From: Alan Cox
Date: Thu Jul 29 2010 - 09:41:32 EST


> In 16550A auto-configuration, if the fifo size is 64 then it's an U6 16550A port

That may not be reliable given the other 8250 clones around but looks
generally sane.


> @@ -2238,6 +2254,10 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
> unsigned long flags;
> unsigned int baud, quot;
>
> + /* Possibly call pre_set_termios function. */
> + if (port->pre_set_termios)
> + port->pre_set_termios(port, termios, old);
> +

Ok I think it might be better to have

serial8250_do_set_termios(...)
{
/* Existing set_termios code here */
}
EXPORT_SYMBOL(serial8250_do_set_termios);

serial8250_set_termios(...)
{
if (port->set_termios)
return port->set_termios(...)
else
serial8250_do_set_termions(...)
}

That allows people to wrap it with before/after/both handling, or replace
it entirely.

So in your case it would

my_set_termios()
{
/* pre set termios code here */
return serial8250_do_set_termios();
}


Looks ok to me though - it splits the special bits out from the core
nicely
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/