aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r--drivers/scsi/sd.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 8613a1317712..03fcbab30033 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -245,24 +245,10 @@ static int sd_init_command(struct scsi_cmnd * SCpnt)
245 * SG_IO from block layer already setup, just copy cdb basically 245 * SG_IO from block layer already setup, just copy cdb basically
246 */ 246 */
247 if (blk_pc_request(rq)) { 247 if (blk_pc_request(rq)) {
248 if (sizeof(rq->cmd) > sizeof(SCpnt->cmnd)) 248 scsi_setup_blk_pc_cmnd(SCpnt, SD_PASSTHROUGH_RETRIES);
249 return 0;
250
251 memcpy(SCpnt->cmnd, rq->cmd, sizeof(SCpnt->cmnd));
252 SCpnt->cmd_len = rq->cmd_len;
253 if (rq_data_dir(rq) == WRITE)
254 SCpnt->sc_data_direction = DMA_TO_DEVICE;
255 else if (rq->data_len)
256 SCpnt->sc_data_direction = DMA_FROM_DEVICE;
257 else
258 SCpnt->sc_data_direction = DMA_NONE;
259
260 this_count = rq->data_len;
261 if (rq->timeout) 249 if (rq->timeout)
262 timeout = rq->timeout; 250 timeout = rq->timeout;
263 251
264 SCpnt->transfersize = rq->data_len;
265 SCpnt->allowed = SD_PASSTHROUGH_RETRIES;
266 goto queue; 252 goto queue;
267 } 253 }
268 254