aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2013-05-05 14:32:29 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-05-16 20:32:22 -0400
commitc4133648bbce9e6b425a74cc890c8e4df51acaa9 (patch)
tree1c5186a72f66cdbacf7b6bd6e14da5fbe370edb2 /drivers/usb
parentdcf0105039660e951dfea348d317043d17988dfc (diff)
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 <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/ftdi_sio.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 242b5776648a..1159fd4cd94d 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -925,7 +925,7 @@ static int ftdi_ioctl(struct tty_struct *tty,
925 unsigned int cmd, unsigned long arg); 925 unsigned int cmd, unsigned long arg);
926static void ftdi_break_ctl(struct tty_struct *tty, int break_state); 926static void ftdi_break_ctl(struct tty_struct *tty, int break_state);
927static int ftdi_chars_in_buffer(struct tty_struct *tty); 927static int ftdi_chars_in_buffer(struct tty_struct *tty);
928static int ftdi_get_modem_status(struct tty_struct *tty, 928static int ftdi_get_modem_status(struct usb_serial_port *port,
929 unsigned char status[2]); 929 unsigned char status[2]);
930 930
931static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base); 931static 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 goto out; 2068 goto out;
2069 2069
2070 /* Check if hardware buffer is empty. */ 2070 /* Check if hardware buffer is empty. */
2071 ret = ftdi_get_modem_status(tty, buf); 2071 ret = ftdi_get_modem_status(port, buf);
2072 if (ret == 2) { 2072 if (ret == 2) {
2073 if (!(buf[1] & FTDI_RS_TEMT)) 2073 if (!(buf[1] & FTDI_RS_TEMT))
2074 chars = 1; 2074 chars = 1;
@@ -2268,10 +2268,9 @@ no_c_cflag_changes:
2268 * Returns the number of status bytes retrieved (device dependant), or 2268 * Returns the number of status bytes retrieved (device dependant), or
2269 * negative error code. 2269 * negative error code.
2270 */ 2270 */
2271static int ftdi_get_modem_status(struct tty_struct *tty, 2271static int ftdi_get_modem_status(struct usb_serial_port *port,
2272 unsigned char status[2]) 2272 unsigned char status[2])
2273{ 2273{
2274 struct usb_serial_port *port = tty->driver_data;
2275 struct ftdi_private *priv = usb_get_serial_port_data(port); 2274 struct ftdi_private *priv = usb_get_serial_port_data(port);
2276 unsigned char *buf; 2275 unsigned char *buf;
2277 int len; 2276 int len;
@@ -2336,7 +2335,7 @@ static int ftdi_tiocmget(struct tty_struct *tty)
2336 unsigned char buf[2]; 2335 unsigned char buf[2];
2337 int ret; 2336 int ret;
2338 2337
2339 ret = ftdi_get_modem_status(tty, buf); 2338 ret = ftdi_get_modem_status(port, buf);
2340 if (ret < 0) 2339 if (ret < 0)
2341 return ret; 2340 return ret;
2342 2341