aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-06-15 18:44:13 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-12 19:34:35 -0400
commit6fcdcf04e391c033eb9a558a744d8729d52e646e (patch)
treef791ccf690ffc6d5ec28446a811f833ea2b9a714 /drivers/usb/serial
parent17c1b35a469b5e518b88cc509562ccfb44950145 (diff)
USB: serial: kobil_sct: clean up urb->status usage
This done in anticipation of removal of urb->status, which will make that patch easier to review and apply in the future. Cc: <linux-usb-devel@lists.sourceforge.net> Cc: Thomas Wahrenbruch <linuxusb@kobil.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/kobil_sct.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
index 0683b51f0932..02a86dbc0e97 100644
--- a/drivers/usb/serial/kobil_sct.c
+++ b/drivers/usb/serial/kobil_sct.c
@@ -358,24 +358,26 @@ static void kobil_close (struct usb_serial_port *port, struct file *filp)
358} 358}
359 359
360 360
361static void kobil_read_int_callback( struct urb *purb) 361static void kobil_read_int_callback(struct urb *urb)
362{ 362{
363 int result; 363 int result;
364 struct usb_serial_port *port = (struct usb_serial_port *) purb->context; 364 struct usb_serial_port *port = urb->context;
365 struct tty_struct *tty; 365 struct tty_struct *tty;
366 unsigned char *data = purb->transfer_buffer; 366 unsigned char *data = urb->transfer_buffer;
367 int status = urb->status;
367// char *dbg_data; 368// char *dbg_data;
368 369
369 dbg("%s - port %d", __FUNCTION__, port->number); 370 dbg("%s - port %d", __FUNCTION__, port->number);
370 371
371 if (purb->status) { 372 if (status) {
372 dbg("%s - port %d Read int status not zero: %d", __FUNCTION__, port->number, purb->status); 373 dbg("%s - port %d Read int status not zero: %d",
374 __FUNCTION__, port->number, status);
373 return; 375 return;
374 } 376 }
375 377
376 tty = port->tty; 378 tty = port->tty;
377 if (purb->actual_length) { 379 if (urb->actual_length) {
378 380
379 // BEGIN DEBUG 381 // BEGIN DEBUG
380 /* 382 /*
381 dbg_data = kzalloc((3 * purb->actual_length + 10) * sizeof(char), GFP_KERNEL); 383 dbg_data = kzalloc((3 * purb->actual_length + 10) * sizeof(char), GFP_KERNEL);
@@ -390,15 +392,15 @@ static void kobil_read_int_callback( struct urb *purb)
390 */ 392 */
391 // END DEBUG 393 // END DEBUG
392 394
393 tty_buffer_request_room(tty, purb->actual_length); 395 tty_buffer_request_room(tty, urb->actual_length);
394 tty_insert_flip_string(tty, data, purb->actual_length); 396 tty_insert_flip_string(tty, data, urb->actual_length);
395 tty_flip_buffer_push(tty); 397 tty_flip_buffer_push(tty);
396 } 398 }
397 399
398 // someone sets the dev to 0 if the close method has been called 400 // someone sets the dev to 0 if the close method has been called
399 port->interrupt_in_urb->dev = port->serial->dev; 401 port->interrupt_in_urb->dev = port->serial->dev;
400 402
401 result = usb_submit_urb( port->interrupt_in_urb, GFP_ATOMIC ); 403 result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
402 dbg("%s - port %d Send read URB returns: %i", __FUNCTION__, port->number, result); 404 dbg("%s - port %d Send read URB returns: %i", __FUNCTION__, port->number, result);
403} 405}
404 406