diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-06-15 18:44:13 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-12 19:34:31 -0400 |
commit | 1373dbbca55503804ed191ba3914af68ce01e4bc (patch) | |
tree | 626fb0e361a7f965487bae675074b0574cee95b5 /drivers/usb | |
parent | 4d0dce3e0b794942407391c52f8dd2760802f391 (diff) |
USB: serial: aircable: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/serial/aircable.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/usb/serial/aircable.c b/drivers/usb/serial/aircable.c index fbc8c27d5d99..1cd29cd6bd00 100644 --- a/drivers/usb/serial/aircable.c +++ b/drivers/usb/serial/aircable.c | |||
@@ -411,12 +411,13 @@ static int aircable_write(struct usb_serial_port *port, | |||
411 | static void aircable_write_bulk_callback(struct urb *urb) | 411 | static void aircable_write_bulk_callback(struct urb *urb) |
412 | { | 412 | { |
413 | struct usb_serial_port *port = urb->context; | 413 | struct usb_serial_port *port = urb->context; |
414 | int status = urb->status; | ||
414 | int result; | 415 | int result; |
415 | 416 | ||
416 | dbg("%s - urb->status: %d", __FUNCTION__ , urb->status); | 417 | dbg("%s - urb status: %d", __FUNCTION__ , status); |
417 | 418 | ||
418 | /* This has been taken from cypress_m8.c cypress_write_int_callback */ | 419 | /* This has been taken from cypress_m8.c cypress_write_int_callback */ |
419 | switch (urb->status) { | 420 | switch (status) { |
420 | case 0: | 421 | case 0: |
421 | /* success */ | 422 | /* success */ |
422 | break; | 423 | break; |
@@ -425,14 +426,14 @@ static void aircable_write_bulk_callback(struct urb *urb) | |||
425 | case -ESHUTDOWN: | 426 | case -ESHUTDOWN: |
426 | /* this urb is terminated, clean up */ | 427 | /* this urb is terminated, clean up */ |
427 | dbg("%s - urb shutting down with status: %d", | 428 | dbg("%s - urb shutting down with status: %d", |
428 | __FUNCTION__, urb->status); | 429 | __FUNCTION__, status); |
429 | port->write_urb_busy = 0; | 430 | port->write_urb_busy = 0; |
430 | return; | 431 | return; |
431 | default: | 432 | default: |
432 | /* error in the urb, so we have to resubmit it */ | 433 | /* error in the urb, so we have to resubmit it */ |
433 | dbg("%s - Overflow in write", __FUNCTION__); | 434 | dbg("%s - Overflow in write", __FUNCTION__); |
434 | dbg("%s - nonzero write bulk status received: %d", | 435 | dbg("%s - nonzero write bulk status received: %d", |
435 | __FUNCTION__, urb->status); | 436 | __FUNCTION__, status); |
436 | port->write_urb->transfer_buffer_length = 1; | 437 | port->write_urb->transfer_buffer_length = 1; |
437 | port->write_urb->dev = port->serial->dev; | 438 | port->write_urb->dev = port->serial->dev; |
438 | result = usb_submit_urb(port->write_urb, GFP_ATOMIC); | 439 | result = usb_submit_urb(port->write_urb, GFP_ATOMIC); |
@@ -457,16 +458,17 @@ static void aircable_read_bulk_callback(struct urb *urb) | |||
457 | unsigned long no_packages, remaining, package_length, i; | 458 | unsigned long no_packages, remaining, package_length, i; |
458 | int result, shift = 0; | 459 | int result, shift = 0; |
459 | unsigned char *temp; | 460 | unsigned char *temp; |
461 | int status = urb->status; | ||
460 | 462 | ||
461 | dbg("%s - port %d", __FUNCTION__, port->number); | 463 | dbg("%s - port %d", __FUNCTION__, port->number); |
462 | 464 | ||
463 | if (urb->status) { | 465 | if (status) { |
464 | dbg("%s - urb->status = %d", __FUNCTION__, urb->status); | 466 | dbg("%s - urb status = %d", __FUNCTION__, status); |
465 | if (!port->open_count) { | 467 | if (!port->open_count) { |
466 | dbg("%s - port is closed, exiting.", __FUNCTION__); | 468 | dbg("%s - port is closed, exiting.", __FUNCTION__); |
467 | return; | 469 | return; |
468 | } | 470 | } |
469 | if (urb->status == -EPROTO) { | 471 | if (status == -EPROTO) { |
470 | dbg("%s - caught -EPROTO, resubmitting the urb", | 472 | dbg("%s - caught -EPROTO, resubmitting the urb", |
471 | __FUNCTION__); | 473 | __FUNCTION__); |
472 | usb_fill_bulk_urb(port->read_urb, port->serial->dev, | 474 | usb_fill_bulk_urb(port->read_urb, port->serial->dev, |