diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2008-12-05 01:25:28 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-12-29 12:24:30 -0500 |
commit | 8ecf0d994a8d3fb439e1efea6f60c22831bf69c8 (patch) | |
tree | 7b0985639458514a18d27c78998ed80e389e4b02 /drivers/scsi/st.c | |
parent | 52107b2c575d76bf210ff7e995128042594324ac (diff) |
[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/st.c')
-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) | |||
2371 | static int read_mode_page(struct scsi_tape *STp, int page, int omit_block_descs) | 2371 | static int read_mode_page(struct scsi_tape *STp, int page, int omit_block_descs) |
2372 | { | 2372 | { |
2373 | unsigned char cmd[MAX_COMMAND_SIZE]; | 2373 | unsigned char cmd[MAX_COMMAND_SIZE]; |
2374 | struct st_request *SRpnt = NULL; | 2374 | struct st_request *SRpnt; |
2375 | int ret; | ||
2375 | 2376 | ||
2376 | memset(cmd, 0, MAX_COMMAND_SIZE); | 2377 | memset(cmd, 0, MAX_COMMAND_SIZE); |
2377 | cmd[0] = MODE_SENSE; | 2378 | cmd[0] = MODE_SENSE; |
@@ -2380,14 +2381,17 @@ static int read_mode_page(struct scsi_tape *STp, int page, int omit_block_descs) | |||
2380 | cmd[2] = page; | 2381 | cmd[2] = page; |
2381 | cmd[4] = 255; | 2382 | cmd[4] = 255; |
2382 | 2383 | ||
2383 | SRpnt = st_do_scsi(SRpnt, STp, cmd, cmd[4], DMA_FROM_DEVICE, | 2384 | SRpnt = st_allocate_request(STp); |
2384 | STp->device->request_queue->rq_timeout, 0, 1); | 2385 | if (!SRpnt) |
2385 | if (SRpnt == NULL) | 2386 | return STp->buffer->syscall_result; |
2386 | return (STp->buffer)->syscall_result; | ||
2387 | 2387 | ||
2388 | ret = st_scsi_kern_execute(SRpnt, cmd, DMA_FROM_DEVICE, | ||
2389 | STp->buffer->b_data, cmd[4], | ||
2390 | STp->device->request_queue->rq_timeout, | ||
2391 | MAX_RETRIES); | ||
2388 | st_release_request(SRpnt); | 2392 | st_release_request(SRpnt); |
2389 | 2393 | ||
2390 | return (STp->buffer)->syscall_result; | 2394 | return ret ? : STp->buffer->syscall_result; |
2391 | } | 2395 | } |
2392 | 2396 | ||
2393 | 2397 | ||