aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/i2o/i2o_scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/message/i2o/i2o_scsi.c')
-rw-r--r--drivers/message/i2o/i2o_scsi.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/drivers/message/i2o/i2o_scsi.c b/drivers/message/i2o/i2o_scsi.c
index 1045c8a518bb..aa6fb9429d58 100644
--- a/drivers/message/i2o/i2o_scsi.c
+++ b/drivers/message/i2o/i2o_scsi.c
@@ -377,12 +377,8 @@ static int i2o_scsi_reply(struct i2o_controller *c, u32 m,
377 osm_err("SCSI error %08x\n", error); 377 osm_err("SCSI error %08x\n", error);
378 378
379 dev = &c->pdev->dev; 379 dev = &c->pdev->dev;
380 if (cmd->use_sg) 380
381 dma_unmap_sg(dev, cmd->request_buffer, cmd->use_sg, 381 scsi_dma_unmap(cmd);
382 cmd->sc_data_direction);
383 else if (cmd->SCp.dma_handle)
384 dma_unmap_single(dev, cmd->SCp.dma_handle, cmd->request_bufflen,
385 cmd->sc_data_direction);
386 382
387 cmd->scsi_done(cmd); 383 cmd->scsi_done(cmd);
388 384
@@ -664,21 +660,15 @@ static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt,
664 660
665 if (sgl_offset != SGL_OFFSET_0) { 661 if (sgl_offset != SGL_OFFSET_0) {
666 /* write size of data addressed by SGL */ 662 /* write size of data addressed by SGL */
667 *mptr++ = cpu_to_le32(SCpnt->request_bufflen); 663 *mptr++ = cpu_to_le32(scsi_bufflen(SCpnt));
668 664
669 /* Now fill in the SGList and command */ 665 /* Now fill in the SGList and command */
670 if (SCpnt->use_sg) { 666
671 if (!i2o_dma_map_sg(c, SCpnt->request_buffer, 667 if (scsi_sg_count(SCpnt)) {
672 SCpnt->use_sg, 668 if (!i2o_dma_map_sg(c, scsi_sglist(SCpnt),
669 scsi_sg_count(SCpnt),
673 SCpnt->sc_data_direction, &mptr)) 670 SCpnt->sc_data_direction, &mptr))
674 goto nomem; 671 goto nomem;
675 } else {
676 SCpnt->SCp.dma_handle =
677 i2o_dma_map_single(c, SCpnt->request_buffer,
678 SCpnt->request_bufflen,
679 SCpnt->sc_data_direction, &mptr);
680 if (dma_mapping_error(SCpnt->SCp.dma_handle))
681 goto nomem;
682 } 672 }
683 } 673 }
684 674