Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+14 -12
+14 -12
drivers/usb/serial/kobil_sct.c
··· 358 358 } 359 359 360 360 361 - static void kobil_read_int_callback( struct urb *purb) 361 + static void kobil_read_int_callback(struct urb *urb) 362 362 { 363 363 int result; 364 - struct usb_serial_port *port = (struct usb_serial_port *) purb->context; 364 + struct usb_serial_port *port = urb->context; 365 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 368 // char *dbg_data; 368 369 369 370 dbg("%s - port %d", __FUNCTION__, port->number); 370 371 371 - if (purb->status) { 372 - dbg("%s - port %d Read int status not zero: %d", __FUNCTION__, port->number, purb->status); 372 + if (status) { 373 + dbg("%s - port %d Read int status not zero: %d", 374 + __FUNCTION__, port->number, status); 373 375 return; 374 376 } 375 - 376 - tty = port->tty; 377 - if (purb->actual_length) { 378 - 377 + 378 + tty = port->tty; 379 + if (urb->actual_length) { 380 + 379 381 // BEGIN DEBUG 380 382 /* 381 383 dbg_data = kzalloc((3 * purb->actual_length + 10) * sizeof(char), GFP_KERNEL); ··· 392 390 */ 393 391 // END DEBUG 394 392 395 - tty_buffer_request_room(tty, purb->actual_length); 396 - tty_insert_flip_string(tty, data, purb->actual_length); 393 + tty_buffer_request_room(tty, urb->actual_length); 394 + tty_insert_flip_string(tty, data, urb->actual_length); 397 395 tty_flip_buffer_push(tty); 398 396 } 399 397 400 398 // someone sets the dev to 0 if the close method has been called 401 399 port->interrupt_in_urb->dev = port->serial->dev; 402 400 403 - result = usb_submit_urb( port->interrupt_in_urb, GFP_ATOMIC ); 401 + result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); 404 402 dbg("%s - port %d Send read URB returns: %i", __FUNCTION__, port->number, result); 405 403 } 406 404