diff options
author | Johan Hovold <jhovold@gmail.com> | 2013-04-18 11:33:20 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-19 13:24:13 -0400 |
commit | b5784f7d8528926d69c5868f1ddb2af99f85e799 (patch) | |
tree | 3a05b8a0d042117c2dcf923fe9d006f970f20047 | |
parent | 113ec31e16afe197a668d4b63ce41e04dc706c64 (diff) |
USB: ti_usb_3410_5052: remove lsr from port data
The line status register is only polled so let's not keep a possibly
outdated value in the port data.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/serial/ti_usb_3410_5052.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index a49d2a746ccf..3ed8ecafe597 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c | |||
@@ -67,7 +67,6 @@ | |||
67 | struct ti_port { | 67 | struct ti_port { |
68 | int tp_is_open; | 68 | int tp_is_open; |
69 | __u8 tp_msr; | 69 | __u8 tp_msr; |
70 | __u8 tp_lsr; | ||
71 | __u8 tp_shadow_mcr; | 70 | __u8 tp_shadow_mcr; |
72 | __u8 tp_uart_mode; /* 232 or 485 modes */ | 71 | __u8 tp_uart_mode; /* 232 or 485 modes */ |
73 | unsigned int tp_uart_base_addr; | 72 | unsigned int tp_uart_base_addr; |
@@ -121,7 +120,7 @@ static void ti_recv(struct usb_serial_port *port, unsigned char *data, | |||
121 | int length); | 120 | int length); |
122 | static void ti_send(struct ti_port *tport); | 121 | static void ti_send(struct ti_port *tport); |
123 | static int ti_set_mcr(struct ti_port *tport, unsigned int mcr); | 122 | static int ti_set_mcr(struct ti_port *tport, unsigned int mcr); |
124 | static int ti_get_lsr(struct ti_port *tport); | 123 | static int ti_get_lsr(struct ti_port *tport, u8 *lsr); |
125 | static int ti_get_serial_info(struct ti_port *tport, | 124 | static int ti_get_serial_info(struct ti_port *tport, |
126 | struct serial_struct __user *ret_arg); | 125 | struct serial_struct __user *ret_arg); |
127 | static int ti_set_serial_info(struct tty_struct *tty, struct ti_port *tport, | 126 | static int ti_set_serial_info(struct tty_struct *tty, struct ti_port *tport, |
@@ -1251,7 +1250,7 @@ static int ti_set_mcr(struct ti_port *tport, unsigned int mcr) | |||
1251 | } | 1250 | } |
1252 | 1251 | ||
1253 | 1252 | ||
1254 | static int ti_get_lsr(struct ti_port *tport) | 1253 | static int ti_get_lsr(struct ti_port *tport, u8 *lsr) |
1255 | { | 1254 | { |
1256 | int size, status; | 1255 | int size, status; |
1257 | struct ti_device *tdev = tport->tp_tdev; | 1256 | struct ti_device *tdev = tport->tp_tdev; |
@@ -1277,7 +1276,7 @@ static int ti_get_lsr(struct ti_port *tport) | |||
1277 | 1276 | ||
1278 | dev_dbg(&port->dev, "%s - lsr 0x%02X\n", __func__, data->bLSR); | 1277 | dev_dbg(&port->dev, "%s - lsr 0x%02X\n", __func__, data->bLSR); |
1279 | 1278 | ||
1280 | tport->tp_lsr = data->bLSR; | 1279 | *lsr = data->bLSR; |
1281 | 1280 | ||
1282 | free_data: | 1281 | free_data: |
1283 | kfree(data); | 1282 | kfree(data); |
@@ -1370,6 +1369,7 @@ static void ti_drain(struct ti_port *tport, unsigned long timeout) | |||
1370 | struct ti_device *tdev = tport->tp_tdev; | 1369 | struct ti_device *tdev = tport->tp_tdev; |
1371 | struct usb_serial_port *port = tport->tp_port; | 1370 | struct usb_serial_port *port = tport->tp_port; |
1372 | wait_queue_t wait; | 1371 | wait_queue_t wait; |
1372 | u8 lsr; | ||
1373 | 1373 | ||
1374 | spin_lock_irq(&tport->tp_lock); | 1374 | spin_lock_irq(&tport->tp_lock); |
1375 | 1375 | ||
@@ -1396,11 +1396,11 @@ static void ti_drain(struct ti_port *tport, unsigned long timeout) | |||
1396 | /* wait for data to drain from the device */ | 1396 | /* wait for data to drain from the device */ |
1397 | /* wait for empty tx register, plus 20 ms */ | 1397 | /* wait for empty tx register, plus 20 ms */ |
1398 | timeout += jiffies; | 1398 | timeout += jiffies; |
1399 | tport->tp_lsr &= ~TI_LSR_TX_EMPTY; | 1399 | lsr = 0; |
1400 | while ((long)(jiffies - timeout) < 0 && !signal_pending(current) | 1400 | while ((long)(jiffies - timeout) < 0 && !signal_pending(current) |
1401 | && !(tport->tp_lsr&TI_LSR_TX_EMPTY) && !tdev->td_urb_error | 1401 | && !(lsr & TI_LSR_TX_EMPTY) && !tdev->td_urb_error |
1402 | && !port->serial->disconnected) { | 1402 | && !port->serial->disconnected) { |
1403 | if (ti_get_lsr(tport)) | 1403 | if (ti_get_lsr(tport, &lsr)) |
1404 | break; | 1404 | break; |
1405 | mutex_unlock(&port->serial->disc_mutex); | 1405 | mutex_unlock(&port->serial->disc_mutex); |
1406 | msleep_interruptible(20); | 1406 | msleep_interruptible(20); |