Skip to content

Commit c413364

Browse files
jhovoldgregkh
authored andcommitted
USB: ftdi_sio: clean up get_modem_status
Use usb-serial port rather than tty as argument to get_modem_status. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent dcf0105 commit c413364

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/usb/serial/ftdi_sio.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ static int ftdi_ioctl(struct tty_struct *tty,
925925
unsigned int cmd, unsigned long arg);
926926
static void ftdi_break_ctl(struct tty_struct *tty, int break_state);
927927
static int ftdi_chars_in_buffer(struct tty_struct *tty);
928-
static int ftdi_get_modem_status(struct tty_struct *tty,
928+
static int ftdi_get_modem_status(struct usb_serial_port *port,
929929
unsigned char status[2]);
930930

931931
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)
20682068
goto out;
20692069

20702070
/* Check if hardware buffer is empty. */
2071-
ret = ftdi_get_modem_status(tty, buf);
2071+
ret = ftdi_get_modem_status(port, buf);
20722072
if (ret == 2) {
20732073
if (!(buf[1] & FTDI_RS_TEMT))
20742074
chars = 1;
@@ -2268,10 +2268,9 @@ static void ftdi_set_termios(struct tty_struct *tty,
22682268
* Returns the number of status bytes retrieved (device dependant), or
22692269
* negative error code.
22702270
*/
2271-
static int ftdi_get_modem_status(struct tty_struct *tty,
2271+
static int ftdi_get_modem_status(struct usb_serial_port *port,
22722272
unsigned char status[2])
22732273
{
2274-
struct usb_serial_port *port = tty->driver_data;
22752274
struct ftdi_private *priv = usb_get_serial_port_data(port);
22762275
unsigned char *buf;
22772276
int len;
@@ -2336,7 +2335,7 @@ static int ftdi_tiocmget(struct tty_struct *tty)
23362335
unsigned char buf[2];
23372336
int ret;
23382337

2339-
ret = ftdi_get_modem_status(tty, buf);
2338+
ret = ftdi_get_modem_status(port, buf);
23402339
if (ret < 0)
23412340
return ret;
23422341

0 commit comments

Comments
 (0)