Commit be171e48 authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

USB: microtek: use set_host_byte()

The SCSI layer is providing a new macro. Let's use it.
Signed-off-by: default avatarOliver Neukum <oneukum@suse.com>
Link: https://lore.kernel.org/r/20200916100302.30855-1-oneukum@suse.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4f6d57e4
...@@ -389,7 +389,7 @@ void mts_int_submit_urb (struct urb* transfer, ...@@ -389,7 +389,7 @@ void mts_int_submit_urb (struct urb* transfer,
res = usb_submit_urb( transfer, GFP_ATOMIC ); res = usb_submit_urb( transfer, GFP_ATOMIC );
if ( unlikely(res) ) { if ( unlikely(res) ) {
MTS_INT_ERROR( "could not submit URB! Error was %d\n",(int)res ); MTS_INT_ERROR( "could not submit URB! Error was %d\n",(int)res );
context->srb->result = DID_ERROR << 16; set_host_byte(context->srb, DID_ERROR);
mts_transfer_cleanup(transfer); mts_transfer_cleanup(transfer);
} }
} }
...@@ -438,7 +438,7 @@ static void mts_data_done( struct urb* transfer ) ...@@ -438,7 +438,7 @@ static void mts_data_done( struct urb* transfer )
scsi_set_resid(context->srb, context->data_length - scsi_set_resid(context->srb, context->data_length -
transfer->actual_length); transfer->actual_length);
} else if ( unlikely(status) ) { } else if ( unlikely(status) ) {
context->srb->result = (status == -ENOENT ? DID_ABORT : DID_ERROR)<<16; set_host_byte(context->srb, (status == -ENOENT ? DID_ABORT : DID_ERROR));
} }
mts_get_status(transfer); mts_get_status(transfer);
...@@ -455,12 +455,12 @@ static void mts_command_done( struct urb *transfer ) ...@@ -455,12 +455,12 @@ static void mts_command_done( struct urb *transfer )
if (status == -ENOENT) { if (status == -ENOENT) {
/* We are being killed */ /* We are being killed */
MTS_DEBUG_GOT_HERE(); MTS_DEBUG_GOT_HERE();
context->srb->result = DID_ABORT<<16; set_host_byte(context->srb, DID_ABORT);
} else { } else {
/* A genuine error has occurred */ /* A genuine error has occurred */
MTS_DEBUG_GOT_HERE(); MTS_DEBUG_GOT_HERE();
context->srb->result = DID_ERROR<<16; set_host_byte(context->srb, DID_ERROR);
} }
mts_transfer_cleanup(transfer); mts_transfer_cleanup(transfer);
...@@ -495,7 +495,7 @@ static void mts_do_sg (struct urb* transfer) ...@@ -495,7 +495,7 @@ static void mts_do_sg (struct urb* transfer)
scsi_sg_count(context->srb)); scsi_sg_count(context->srb));
if (unlikely(status)) { if (unlikely(status)) {
context->srb->result = (status == -ENOENT ? DID_ABORT : DID_ERROR)<<16; set_host_byte(context->srb, (status == -ENOENT ? DID_ABORT : DID_ERROR));
mts_transfer_cleanup(transfer); mts_transfer_cleanup(transfer);
} }
...@@ -578,7 +578,7 @@ mts_scsi_queuecommand_lck(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback ...@@ -578,7 +578,7 @@ mts_scsi_queuecommand_lck(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback
MTS_DEBUG("this device doesn't exist\n"); MTS_DEBUG("this device doesn't exist\n");
srb->result = DID_BAD_TARGET << 16; set_host_byte(srb, DID_BAD_TARGET);
if(likely(callback != NULL)) if(likely(callback != NULL))
callback(srb); callback(srb);
...@@ -605,7 +605,7 @@ mts_scsi_queuecommand_lck(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback ...@@ -605,7 +605,7 @@ mts_scsi_queuecommand_lck(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback
if(unlikely(res)){ if(unlikely(res)){
MTS_ERROR("error %d submitting URB\n",(int)res); MTS_ERROR("error %d submitting URB\n",(int)res);
srb->result = DID_ERROR << 16; set_host_byte(srb, DID_ERROR);
if(likely(callback != NULL)) if(likely(callback != NULL))
callback(srb); callback(srb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment