提交 c4133648 编写于 作者: J Johan Hovold 提交者: Greg Kroah-Hartman

USB: ftdi_sio: clean up get_modem_status

Use usb-serial port rather than tty as argument to get_modem_status.
Signed-off-by: NJohan Hovold <jhovold@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 dcf01050
...@@ -925,7 +925,7 @@ static int ftdi_ioctl(struct tty_struct *tty, ...@@ -925,7 +925,7 @@ static int ftdi_ioctl(struct tty_struct *tty,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
static void ftdi_break_ctl(struct tty_struct *tty, int break_state); static void ftdi_break_ctl(struct tty_struct *tty, int break_state);
static int ftdi_chars_in_buffer(struct tty_struct *tty); static int ftdi_chars_in_buffer(struct tty_struct *tty);
static int ftdi_get_modem_status(struct tty_struct *tty, static int ftdi_get_modem_status(struct usb_serial_port *port,
unsigned char status[2]); unsigned char status[2]);
static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base); static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base);
...@@ -2068,7 +2068,7 @@ static int ftdi_chars_in_buffer(struct tty_struct *tty) ...@@ -2068,7 +2068,7 @@ static int ftdi_chars_in_buffer(struct tty_struct *tty)
goto out; goto out;
/* Check if hardware buffer is empty. */ /* Check if hardware buffer is empty. */
ret = ftdi_get_modem_status(tty, buf); ret = ftdi_get_modem_status(port, buf);
if (ret == 2) { if (ret == 2) {
if (!(buf[1] & FTDI_RS_TEMT)) if (!(buf[1] & FTDI_RS_TEMT))
chars = 1; chars = 1;
...@@ -2268,10 +2268,9 @@ static void ftdi_set_termios(struct tty_struct *tty, ...@@ -2268,10 +2268,9 @@ static void ftdi_set_termios(struct tty_struct *tty,
* Returns the number of status bytes retrieved (device dependant), or * Returns the number of status bytes retrieved (device dependant), or
* negative error code. * negative error code.
*/ */
static int ftdi_get_modem_status(struct tty_struct *tty, static int ftdi_get_modem_status(struct usb_serial_port *port,
unsigned char status[2]) unsigned char status[2])
{ {
struct usb_serial_port *port = tty->driver_data;
struct ftdi_private *priv = usb_get_serial_port_data(port); struct ftdi_private *priv = usb_get_serial_port_data(port);
unsigned char *buf; unsigned char *buf;
int len; int len;
...@@ -2336,7 +2335,7 @@ static int ftdi_tiocmget(struct tty_struct *tty) ...@@ -2336,7 +2335,7 @@ static int ftdi_tiocmget(struct tty_struct *tty)
unsigned char buf[2]; unsigned char buf[2];
int ret; int ret;
ret = ftdi_get_modem_status(tty, buf); ret = ftdi_get_modem_status(port, buf);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册