diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/st.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 11341b717bba..c200496e90fe 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c | |||
@@ -874,21 +874,24 @@ static int test_ready(struct scsi_tape *STp, int do_wait) | |||
874 | int attentions, waits, max_wait, scode; | 874 | int attentions, waits, max_wait, scode; |
875 | int retval = CHKRES_READY, new_session = 0; | 875 | int retval = CHKRES_READY, new_session = 0; |
876 | unsigned char cmd[MAX_COMMAND_SIZE]; | 876 | unsigned char cmd[MAX_COMMAND_SIZE]; |
877 | struct st_request *SRpnt = NULL; | 877 | struct st_request *SRpnt; |
878 | struct st_cmdstatus *cmdstatp = &STp->buffer->cmdstat; | 878 | struct st_cmdstatus *cmdstatp = &STp->buffer->cmdstat; |
879 | 879 | ||
880 | SRpnt = st_allocate_request(STp); | ||
881 | if (!SRpnt) | ||
882 | return STp->buffer->syscall_result; | ||
883 | |||
880 | max_wait = do_wait ? ST_BLOCK_SECONDS : 0; | 884 | max_wait = do_wait ? ST_BLOCK_SECONDS : 0; |
881 | 885 | ||
882 | for (attentions=waits=0; ; ) { | 886 | for (attentions=waits=0; ; ) { |
883 | memset((void *) &cmd[0], 0, MAX_COMMAND_SIZE); | 887 | memset((void *) &cmd[0], 0, MAX_COMMAND_SIZE); |
884 | cmd[0] = TEST_UNIT_READY; | 888 | cmd[0] = TEST_UNIT_READY; |
885 | SRpnt = st_do_scsi(SRpnt, STp, cmd, 0, DMA_NONE, | ||
886 | STp->long_timeout, MAX_READY_RETRIES, 1); | ||
887 | 889 | ||
888 | if (!SRpnt) { | 890 | retval = st_scsi_kern_execute(SRpnt, cmd, DMA_NONE, NULL, 0, |
889 | retval = (STp->buffer)->syscall_result; | 891 | STp->long_timeout, |
892 | MAX_READY_RETRIES); | ||
893 | if (retval) | ||
890 | break; | 894 | break; |
891 | } | ||
892 | 895 | ||
893 | if (cmdstatp->have_sense) { | 896 | if (cmdstatp->have_sense) { |
894 | 897 | ||
@@ -932,8 +935,8 @@ static int test_ready(struct scsi_tape *STp, int do_wait) | |||
932 | break; | 935 | break; |
933 | } | 936 | } |
934 | 937 | ||
935 | if (SRpnt != NULL) | 938 | st_release_request(SRpnt); |
936 | st_release_request(SRpnt); | 939 | |
937 | return retval; | 940 | return retval; |
938 | } | 941 | } |
939 | 942 | ||