mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
USB: ftdi_sio: clean up get_modem_status
commit c4133648bb
upstream.
Use usb-serial port rather than tty as argument to get_modem_status.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9e8b683555
commit
2ee6eba44c
@ -932,7 +932,7 @@ static int ftdi_ioctl(struct tty_struct *tty,
|
||||
unsigned int cmd, unsigned long arg);
|
||||
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_get_modem_status(struct tty_struct *tty,
|
||||
static int ftdi_get_modem_status(struct usb_serial_port *port,
|
||||
unsigned char status[2]);
|
||||
|
||||
static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base);
|
||||
@ -2104,7 +2104,7 @@ static int ftdi_chars_in_buffer(struct tty_struct *tty)
|
||||
goto out;
|
||||
|
||||
/* Check if hardware buffer is empty. */
|
||||
ret = ftdi_get_modem_status(tty, buf);
|
||||
ret = ftdi_get_modem_status(port, buf);
|
||||
if (ret == 2) {
|
||||
if (!(buf[1] & FTDI_RS_TEMT))
|
||||
chars = 1;
|
||||
@ -2304,10 +2304,9 @@ static void ftdi_set_termios(struct tty_struct *tty,
|
||||
* Returns the number of status bytes retrieved (device dependant), or
|
||||
* 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])
|
||||
{
|
||||
struct usb_serial_port *port = tty->driver_data;
|
||||
struct ftdi_private *priv = usb_get_serial_port_data(port);
|
||||
unsigned char *buf;
|
||||
int len;
|
||||
@ -2372,7 +2371,7 @@ static int ftdi_tiocmget(struct tty_struct *tty)
|
||||
unsigned char buf[2];
|
||||
int ret;
|
||||
|
||||
ret = ftdi_get_modem_status(tty, buf);
|
||||
ret = ftdi_get_modem_status(port, buf);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user