aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/iuu_phoenix.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2008-12-10 19:00:30 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-07 13:00:06 -0500
commit50de36f7af3b1d791c402478210790c582126fe5 (patch)
tree78d3353450be45315bb2ffa1cd7c664c26458c73 /drivers/usb/serial/iuu_phoenix.c
parent6013bbbab0dcbc43bcf9dd70beeab2a0b1ec5ea7 (diff)
USB: serial: fix up urb->status usage
Some of the usb-serial drivers are starting to use urb->status in ways they should not be doing. This fixes up some of them to prevent that. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/iuu_phoenix.c')
-rw-r--r--drivers/usb/serial/iuu_phoenix.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c
index e320972cb227..2314c6ae4fc2 100644
--- a/drivers/usb/serial/iuu_phoenix.c
+++ b/drivers/usb/serial/iuu_phoenix.c
@@ -190,10 +190,12 @@ static void iuu_rxcmd(struct urb *urb)
190{ 190{
191 struct usb_serial_port *port = urb->context; 191 struct usb_serial_port *port = urb->context;
192 int result; 192 int result;
193 int status = urb->status;
194
193 dbg("%s - enter", __func__); 195 dbg("%s - enter", __func__);
194 196
195 if (urb->status) { 197 if (status) {
196 dbg("%s - urb->status = %d", __func__, urb->status); 198 dbg("%s - status = %d", __func__, status);
197 /* error stop all */ 199 /* error stop all */
198 return; 200 return;
199 } 201 }
@@ -245,10 +247,12 @@ static void iuu_update_status_callback(struct urb *urb)
245 struct usb_serial_port *port = urb->context; 247 struct usb_serial_port *port = urb->context;
246 struct iuu_private *priv = usb_get_serial_port_data(port); 248 struct iuu_private *priv = usb_get_serial_port_data(port);
247 u8 *st; 249 u8 *st;
250 int status = urb->status;
251
248 dbg("%s - enter", __func__); 252 dbg("%s - enter", __func__);
249 253
250 if (urb->status) { 254 if (status) {
251 dbg("%s - urb->status = %d", __func__, urb->status); 255 dbg("%s - status = %d", __func__, status);
252 /* error stop all */ 256 /* error stop all */
253 return; 257 return;
254 } 258 }
@@ -274,9 +278,9 @@ static void iuu_status_callback(struct urb *urb)
274{ 278{
275 struct usb_serial_port *port = urb->context; 279 struct usb_serial_port *port = urb->context;
276 int result; 280 int result;
277 dbg("%s - enter", __func__); 281 int status = urb->status;
278 282
279 dbg("%s - urb->status = %d", __func__, urb->status); 283 dbg("%s - status = %d", __func__, status);
280 usb_fill_bulk_urb(port->read_urb, port->serial->dev, 284 usb_fill_bulk_urb(port->read_urb, port->serial->dev,
281 usb_rcvbulkpipe(port->serial->dev, 285 usb_rcvbulkpipe(port->serial->dev,
282 port->bulk_in_endpointAddress), 286 port->bulk_in_endpointAddress),
@@ -618,11 +622,12 @@ static void read_buf_callback(struct urb *urb)
618 struct usb_serial_port *port = urb->context; 622 struct usb_serial_port *port = urb->context;
619 unsigned char *data = urb->transfer_buffer; 623 unsigned char *data = urb->transfer_buffer;
620 struct tty_struct *tty; 624 struct tty_struct *tty;
621 dbg("%s - urb->status = %d", __func__, urb->status); 625 int status = urb->status;
622 626
623 if (urb->status) { 627 dbg("%s - status = %d", __func__, status);
624 dbg("%s - urb->status = %d", __func__, urb->status); 628
625 if (urb->status == -EPROTO) { 629 if (status) {
630 if (status == -EPROTO) {
626 /* reschedule needed */ 631 /* reschedule needed */
627 } 632 }
628 return; 633 return;
@@ -695,7 +700,7 @@ static void iuu_uart_read_callback(struct urb *urb)
695 struct usb_serial_port *port = urb->context; 700 struct usb_serial_port *port = urb->context;
696 struct iuu_private *priv = usb_get_serial_port_data(port); 701 struct iuu_private *priv = usb_get_serial_port_data(port);
697 unsigned long flags; 702 unsigned long flags;
698 int status; 703 int status = urb->status;
699 int error = 0; 704 int error = 0;
700 int len = 0; 705 int len = 0;
701 unsigned char *data = urb->transfer_buffer; 706 unsigned char *data = urb->transfer_buffer;
@@ -703,8 +708,8 @@ static void iuu_uart_read_callback(struct urb *urb)
703 708
704 dbg("%s - enter", __func__); 709 dbg("%s - enter", __func__);
705 710
706 if (urb->status) { 711 if (status) {
707 dbg("%s - urb->status = %d", __func__, urb->status); 712 dbg("%s - status = %d", __func__, status);
708 /* error stop all */ 713 /* error stop all */
709 return; 714 return;
710 } 715 }
@@ -782,12 +787,11 @@ static void read_rxcmd_callback(struct urb *urb)
782{ 787{
783 struct usb_serial_port *port = urb->context; 788 struct usb_serial_port *port = urb->context;
784 int result; 789 int result;
785 dbg("%s - enter", __func__); 790 int status = urb->status;
786 791
787 dbg("%s - urb->status = %d", __func__, urb->status); 792 dbg("%s - status = %d", __func__, status);
788 793
789 if (urb->status) { 794 if (status) {
790 dbg("%s - urb->status = %d", __func__, urb->status);
791 /* error stop all */ 795 /* error stop all */
792 return; 796 return;
793 } 797 }