From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Wen Xiong <wendyx@us.ibm.com>
Cc: Arjan van de Ven <arjan@infradead.org>, Greg KH <greg@kroah.com>,
linux-kernel@vger.kernel.org
Subject: Re: [ patch 3/5] drivers/serial/jsm: new serial device driver
Date: Wed, 30 Mar 2005 16:01:45 +0100 [thread overview]
Message-ID: <20050330160144.B13781@flint.arm.linux.org.uk> (raw)
In-Reply-To: <42321CEA.2000405@us.ltcfwd.linux.ibm.com>; from wendyx@us.ibm.com on Fri, Mar 11, 2005 at 05:34:18PM -0500
On Fri, Mar 11, 2005 at 05:34:18PM -0500, Wen Xiong wrote:
> diff -Nuar linux-2.6.11.org/drivers/serial/jsm/jsm_neo.c linux-2.6.11.new/drivers/serial/jsm/jsm_neo.c
> --- linux-2.6.11.org/drivers/serial/jsm/jsm_neo.c 1969-12-31 18:00:00.000000000 -0600
> +++ linux-2.6.11.new/drivers/serial/jsm/jsm_neo.c 2005-03-11 16:26:47.442988256 -0600
> +/*
> + * neo_param()
> + * Send any/all changes to the line to the UART.
> + */
> +static void neo_param(struct jsm_channel *ch)
> +{
> + u8 lcr = 0;
> + u8 uart_lcr = 0;
> + u8 ier = 0;
> + u32 baud = 9600;
> + int quot = 0;
> + struct jsm_board *bd;
> +
> + bd = ch->ch_bd;
> + if (!bd)
> + return;
> +
> + /*
> + * If baud rate is zero, flush queues, and set mval to drop DTR.
> + */
The modem signal side of this is already handled for you.
> + const u64 bauds[4][16] = {
> + {
> + 0, 50, 75, 110,
> + 134, 150, 200, 300,
> + 600, 1200, 1800, 2400,
> + 4800, 9600, 19200, 38400 },
> + {
> + 0, 57600, 115200, 230400,
> + 460800, 150, 200, 921600,
> + 600, 1200, 1800, 2400,
> + 4800, 9600, 19200, 38400 },
> + {
> + 0, 57600, 76800, 115200,
> + 131657, 153600, 230400, 460800,
> + 921600, 1200, 1800, 2400,
> + 4800, 9600, 19200, 38400 },
> + {
> + 0, 57600, 115200, 230400,
> + 460800, 150, 200, 921600,
> + 600, 1200, 1800, 2400,
> + 4800, 9600, 19200, 38400 }
> + };
> +
> + baud = C_BAUD(ch->uart_port.info->tty) & 0xff;
> +
> + if (ch->ch_c_cflag & CBAUDEX)
> + iindex = 1;
This is buggy. You're making invalid assumptions about the
given baud rate flags in the termios. Use the helper functions
provided please.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
next prev parent reply other threads:[~2005-03-30 15:02 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-27 23:39 [ patch 4/7] drivers/serial/jsm: new serial device driver Wen Xiong
2005-02-28 3:21 ` Christoph Hellwig
2005-02-28 6:39 ` Greg KH
2005-03-04 21:08 ` Wen Xiong
2005-03-04 22:01 ` Greg KH
2005-03-07 22:46 ` Wen Xiong
2005-03-08 6:44 ` Greg KH
2005-03-08 18:55 ` Wen Xiong
2005-03-08 23:58 ` Greg KH
2005-03-09 15:47 ` Wen Xiong
2005-03-09 16:35 ` Greg KH
2005-03-09 17:18 ` Wen Xiong
2005-03-09 18:58 ` Greg KH
2005-03-11 15:29 ` [ patch 1/5] " Wen Xiong
2005-03-12 13:06 ` Domen Puncer
2005-03-14 17:35 ` Wen Xiong
2005-03-14 20:24 ` Domen Puncer
2005-03-14 21:24 ` Wen Xiong
2005-03-11 15:32 ` [ patch 2/5] " Wen Xiong
2005-03-30 14:55 ` Russell King
2005-03-11 15:38 ` [ patch 3/5] " Wen Xiong
2005-03-11 15:53 ` Arjan van de Ven
2005-03-11 16:39 ` Wen Xiong
2005-03-11 16:46 ` Arjan van de Ven
2005-03-11 22:34 ` Wen Xiong
2005-03-30 15:01 ` Russell King [this message]
2005-03-11 15:38 ` [ patch 4/5] " Wen Xiong
2005-03-11 15:38 ` [ patch 5/5] " Wen Xiong
2005-03-09 16:11 ` [ patch 4/7] " Russell King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050330160144.B13781@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=arjan@infradead.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=wendyx@us.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.