aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/image/microtek.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/image/microtek.c')
-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