aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/image
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-07-18 13:58:02 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-19 20:46:06 -0400
commitb44cd112a0400d5eb381f3c1a1e7a6925911c835 (patch)
tree26d8683f1f8695b8b633726ab3c8c2cc2916f552 /drivers/usb/image
parentdd6fa4d755fb1e2822406ab8ce3d28db217acc01 (diff)
USB: image: microtek: 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. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/image')
-rw-r--r--drivers/usb/image/microtek.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c
index 51bd80d2b8cc..768b2c11a231 100644
--- a/drivers/usb/image/microtek.c
+++ b/drivers/usb/image/microtek.c
@@ -189,7 +189,7 @@ static struct usb_driver mts_usb_driver = {
189#define MTS_DEBUG_INT() \ 189#define MTS_DEBUG_INT() \
190 do { MTS_DEBUG_GOT_HERE(); \ 190 do { MTS_DEBUG_GOT_HERE(); \
191 MTS_DEBUG("transfer = 0x%x context = 0x%x\n",(int)transfer,(int)context ); \ 191 MTS_DEBUG("transfer = 0x%x context = 0x%x\n",(int)transfer,(int)context ); \
192 MTS_DEBUG("status = 0x%x data-length = 0x%x sent = 0x%x\n",(int)transfer->status,(int)context->data_length, (int)transfer->actual_length ); \ 192 MTS_DEBUG("status = 0x%x data-length = 0x%x sent = 0x%x\n",transfer->status,(int)context->data_length, (int)transfer->actual_length ); \
193 mts_debug_dump(context->instance);\ 193 mts_debug_dump(context->instance);\
194 } while(0) 194 } while(0)
195#else 195#else
@@ -393,8 +393,6 @@ void mts_int_submit_urb (struct urb* transfer,
393 context 393 context
394 ); 394 );
395 395
396 transfer->status = 0;
397
398 res = usb_submit_urb( transfer, GFP_ATOMIC ); 396 res = usb_submit_urb( transfer, GFP_ATOMIC );
399 if ( unlikely(res) ) { 397 if ( unlikely(res) ) {
400 MTS_INT_ERROR( "could not submit URB! Error was %d\n",(int)res ); 398 MTS_INT_ERROR( "could not submit URB! Error was %d\n",(int)res );
@@ -444,12 +442,13 @@ static void mts_get_status( struct urb *transfer )
444static void mts_data_done( struct urb* transfer ) 442static void mts_data_done( struct urb* transfer )
445/* Interrupt context! */ 443/* Interrupt context! */
446{ 444{
445 int status = transfer->status;
447 MTS_INT_INIT(); 446 MTS_INT_INIT();
448 447
449 if ( context->data_length != transfer->actual_length ) { 448 if ( context->data_length != transfer->actual_length ) {
450 context->srb->resid = context->data_length - transfer->actual_length; 449 context->srb->resid = context->data_length - transfer->actual_length;
451 } else if ( unlikely(transfer->status) ) { 450 } else if ( unlikely(status) ) {
452 context->srb->result = (transfer->status == -ENOENT ? DID_ABORT : DID_ERROR)<<16; 451 context->srb->result = (status == -ENOENT ? DID_ABORT : DID_ERROR)<<16;
453 } 452 }
454 453
455 mts_get_status(transfer); 454 mts_get_status(transfer);
@@ -461,10 +460,11 @@ static void mts_data_done( struct urb* transfer )
461static void mts_command_done( struct urb *transfer ) 460static void mts_command_done( struct urb *transfer )
462/* Interrupt context! */ 461/* Interrupt context! */
463{ 462{
463 int status = transfer->status;
464 MTS_INT_INIT(); 464 MTS_INT_INIT();
465 465
466 if ( unlikely(transfer->status) ) { 466 if ( unlikely(status) ) {
467 if (transfer->status == -ENOENT) { 467 if (status == -ENOENT) {
468 /* We are being killed */ 468 /* We are being killed */
469 MTS_DEBUG_GOT_HERE(); 469 MTS_DEBUG_GOT_HERE();
470 context->srb->result = DID_ABORT<<16; 470 context->srb->result = DID_ABORT<<16;
@@ -502,12 +502,13 @@ static void mts_command_done( struct urb *transfer )
502static void mts_do_sg (struct urb* transfer) 502static void mts_do_sg (struct urb* transfer)
503{ 503{
504 struct scatterlist * sg; 504 struct scatterlist * sg;
505 int status = transfer->status;
505 MTS_INT_INIT(); 506 MTS_INT_INIT();
506 507
507 MTS_DEBUG("Processing fragment %d of %d\n", context->fragment,context->srb->use_sg); 508 MTS_DEBUG("Processing fragment %d of %d\n", context->fragment,context->srb->use_sg);
508 509
509 if (unlikely(transfer->status)) { 510 if (unlikely(status)) {
510 context->srb->result = (transfer->status == -ENOENT ? DID_ABORT : DID_ERROR)<<16; 511 context->srb->result = (status == -ENOENT ? DID_ABORT : DID_ERROR)<<16;
511 mts_transfer_cleanup(transfer); 512 mts_transfer_cleanup(transfer);
512 } 513 }
513 514