aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2008-12-05 01:25:29 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-12-29 12:24:31 -0500
commit18c87015741d931875038789957db55b00661f5b (patch)
tree5211c02c787137292dff4ed971825558ad9e0b9a
parent8ecf0d994a8d3fb439e1efea6f60c22831bf69c8 (diff)
[SCSI] st: convert write_mode_page to use st_scsi_kern_execute
This replaces st_do_scsi in write_mode_page (MODE_SELECT) 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>
-rw-r--r--drivers/scsi/st.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 1951fb4ed404..09d06bdd25dd 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -2399,9 +2399,9 @@ static int read_mode_page(struct scsi_tape *STp, int page, int omit_block_descs)
2399 in the buffer is correctly formatted. The long timeout is used if slow is non-zero. */ 2399 in the buffer is correctly formatted. The long timeout is used if slow is non-zero. */
2400static int write_mode_page(struct scsi_tape *STp, int page, int slow) 2400static int write_mode_page(struct scsi_tape *STp, int page, int slow)
2401{ 2401{
2402 int pgo; 2402 int pgo, timeout, ret = 0;
2403 unsigned char cmd[MAX_COMMAND_SIZE]; 2403 unsigned char cmd[MAX_COMMAND_SIZE];
2404 struct st_request *SRpnt = NULL; 2404 struct st_request *SRpnt;
2405 2405
2406 memset(cmd, 0, MAX_COMMAND_SIZE); 2406 memset(cmd, 0, MAX_COMMAND_SIZE);
2407 cmd[0] = MODE_SELECT; 2407 cmd[0] = MODE_SELECT;
@@ -2415,14 +2415,21 @@ static int write_mode_page(struct scsi_tape *STp, int page, int slow)
2415 (STp->buffer)->b_data[MH_OFF_DEV_SPECIFIC] &= ~MH_BIT_WP; 2415 (STp->buffer)->b_data[MH_OFF_DEV_SPECIFIC] &= ~MH_BIT_WP;
2416 (STp->buffer)->b_data[pgo + MP_OFF_PAGE_NBR] &= MP_MSK_PAGE_NBR; 2416 (STp->buffer)->b_data[pgo + MP_OFF_PAGE_NBR] &= MP_MSK_PAGE_NBR;
2417 2417
2418 SRpnt = st_do_scsi(SRpnt, STp, cmd, cmd[4], DMA_TO_DEVICE, 2418 SRpnt = st_allocate_request(STp);
2419 (slow ? STp->long_timeout : STp->device->request_queue->rq_timeout), 0, 1); 2419 if (!SRpnt)
2420 if (SRpnt == NULL) 2420 return ret;
2421 return (STp->buffer)->syscall_result; 2421
2422 timeout = slow ? STp->long_timeout :
2423 STp->device->request_queue->rq_timeout;
2424
2425 ret = st_scsi_kern_execute(SRpnt, cmd, DMA_TO_DEVICE,
2426 STp->buffer->b_data, cmd[4], timeout, 0);
2427 if (!ret)
2428 ret = STp->buffer->syscall_result;
2422 2429
2423 st_release_request(SRpnt); 2430 st_release_request(SRpnt);
2424 2431
2425 return (STp->buffer)->syscall_result; 2432 return ret;
2426} 2433}
2427 2434
2428 2435