diff options
Diffstat (limited to 'drivers/scsi/sr.c')
-rw-r--r-- | drivers/scsi/sr.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index d68cea753bb2..fb4012b5c188 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c | |||
@@ -320,25 +320,11 @@ static int sr_init_command(struct scsi_cmnd * SCpnt) | |||
320 | * these are already setup, just copy cdb basically | 320 | * these are already setup, just copy cdb basically |
321 | */ | 321 | */ |
322 | if (SCpnt->request->flags & REQ_BLOCK_PC) { | 322 | if (SCpnt->request->flags & REQ_BLOCK_PC) { |
323 | struct request *rq = SCpnt->request; | 323 | scsi_setup_blk_pc_cmnd(SCpnt, MAX_RETRIES); |
324 | 324 | ||
325 | if (sizeof(rq->cmd) > sizeof(SCpnt->cmnd)) | 325 | if (SCpnt->timeout_per_command) |
326 | return 0; | 326 | timeout = SCpnt->timeout_per_command; |
327 | |||
328 | memcpy(SCpnt->cmnd, rq->cmd, sizeof(SCpnt->cmnd)); | ||
329 | SCpnt->cmd_len = rq->cmd_len; | ||
330 | if (!rq->data_len) | ||
331 | SCpnt->sc_data_direction = DMA_NONE; | ||
332 | else if (rq_data_dir(rq) == WRITE) | ||
333 | SCpnt->sc_data_direction = DMA_TO_DEVICE; | ||
334 | else | ||
335 | SCpnt->sc_data_direction = DMA_FROM_DEVICE; | ||
336 | |||
337 | this_count = rq->data_len; | ||
338 | if (rq->timeout) | ||
339 | timeout = rq->timeout; | ||
340 | 327 | ||
341 | SCpnt->transfersize = rq->data_len; | ||
342 | goto queue; | 328 | goto queue; |
343 | } | 329 | } |
344 | 330 | ||