Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61950
b: refs/heads/master
c: b44cd11
h: refs/heads/master
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Jul 20, 2007
1 parent ec8c784 commit f5cf187
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dd6fa4d755fb1e2822406ab8ce3d28db217acc01
refs/heads/master: b44cd112a0400d5eb381f3c1a1e7a6925911c835
19 changes: 10 additions & 9 deletions trunk/drivers/usb/image/microtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ static struct usb_driver mts_usb_driver = {
#define MTS_DEBUG_INT() \
do { MTS_DEBUG_GOT_HERE(); \
MTS_DEBUG("transfer = 0x%x context = 0x%x\n",(int)transfer,(int)context ); \
MTS_DEBUG("status = 0x%x data-length = 0x%x sent = 0x%x\n",(int)transfer->status,(int)context->data_length, (int)transfer->actual_length ); \
MTS_DEBUG("status = 0x%x data-length = 0x%x sent = 0x%x\n",transfer->status,(int)context->data_length, (int)transfer->actual_length ); \
mts_debug_dump(context->instance);\
} while(0)
#else
Expand Down Expand Up @@ -393,8 +393,6 @@ void mts_int_submit_urb (struct urb* transfer,
context
);

transfer->status = 0;

res = usb_submit_urb( transfer, GFP_ATOMIC );
if ( unlikely(res) ) {
MTS_INT_ERROR( "could not submit URB! Error was %d\n",(int)res );
Expand Down Expand Up @@ -444,12 +442,13 @@ static void mts_get_status( struct urb *transfer )
static void mts_data_done( struct urb* transfer )
/* Interrupt context! */
{
int status = transfer->status;
MTS_INT_INIT();

if ( context->data_length != transfer->actual_length ) {
context->srb->resid = context->data_length - transfer->actual_length;
} else if ( unlikely(transfer->status) ) {
context->srb->result = (transfer->status == -ENOENT ? DID_ABORT : DID_ERROR)<<16;
} else if ( unlikely(status) ) {
context->srb->result = (status == -ENOENT ? DID_ABORT : DID_ERROR)<<16;
}

mts_get_status(transfer);
Expand All @@ -461,10 +460,11 @@ static void mts_data_done( struct urb* transfer )
static void mts_command_done( struct urb *transfer )
/* Interrupt context! */
{
int status = transfer->status;
MTS_INT_INIT();

if ( unlikely(transfer->status) ) {
if (transfer->status == -ENOENT) {
if ( unlikely(status) ) {
if (status == -ENOENT) {
/* We are being killed */
MTS_DEBUG_GOT_HERE();
context->srb->result = DID_ABORT<<16;
Expand Down Expand Up @@ -502,12 +502,13 @@ static void mts_command_done( struct urb *transfer )
static void mts_do_sg (struct urb* transfer)
{
struct scatterlist * sg;
int status = transfer->status;
MTS_INT_INIT();

MTS_DEBUG("Processing fragment %d of %d\n", context->fragment,context->srb->use_sg);

if (unlikely(transfer->status)) {
context->srb->result = (transfer->status == -ENOENT ? DID_ABORT : DID_ERROR)<<16;
if (unlikely(status)) {
context->srb->result = (status == -ENOENT ? DID_ABORT : DID_ERROR)<<16;
mts_transfer_cleanup(transfer);
}

Expand Down

0 comments on commit f5cf187

Please sign in to comment.