diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2008-12-05 15:25:28 +0900 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-12-29 11:24:30 -0600 |
commit | 8ecf0d994a8d3fb439e1efea6f60c22831bf69c8 (patch) | |
tree | 7b0985639458514a18d27c78998ed80e389e4b02 /drivers/scsi | |
parent | 52107b2c575d76bf210ff7e995128042594324ac (diff) | |
download | blackbird-op-linux-8ecf0d994a8d3fb439e1efea6f60c22831bf69c8.tar.gz blackbird-op-linux-8ecf0d994a8d3fb439e1efea6f60c22831bf69c8.zip |
[SCSI] st: convert read_mode_page to use st_scsi_kern_execute
This replaces st_do_scsi in read_mode_page (MODE_SENSE) with
st_scsi_kern_execute.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Kai Makisara <Kai.Makisara@kolumbus.fi>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/st.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 322ca87d252e..1951fb4ed404 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -2371,7 +2371,8 @@ static int st_set_options(struct scsi_tape *STp, long options) static int read_mode_page(struct scsi_tape *STp, int page, int omit_block_descs) { unsigned char cmd[MAX_COMMAND_SIZE]; - struct st_request *SRpnt = NULL; + struct st_request *SRpnt; + int ret; memset(cmd, 0, MAX_COMMAND_SIZE); cmd[0] = MODE_SENSE; @@ -2380,14 +2381,17 @@ static int read_mode_page(struct scsi_tape *STp, int page, int omit_block_descs) cmd[2] = page; cmd[4] = 255; - SRpnt = st_do_scsi(SRpnt, STp, cmd, cmd[4], DMA_FROM_DEVICE, - STp->device->request_queue->rq_timeout, 0, 1); - if (SRpnt == NULL) - return (STp->buffer)->syscall_result; + SRpnt = st_allocate_request(STp); + if (!SRpnt) + return STp->buffer->syscall_result; + ret = st_scsi_kern_execute(SRpnt, cmd, DMA_FROM_DEVICE, + STp->buffer->b_data, cmd[4], + STp->device->request_queue->rq_timeout, + MAX_RETRIES); st_release_request(SRpnt); - return (STp->buffer)->syscall_result; + return ret ? : STp->buffer->syscall_result; } |