Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0ea7154fbc740e8c44f6175fc44c4e56fbbbdc0f
Commit:     0ea7154fbc740e8c44f6175fc44c4e56fbbbdc0f
Parent:     29c976844d0bef07d97babc8db60fa6c46788133
Author:     FUJITA Tomonori <[EMAIL PROTECTED]>
AuthorDate: Thu Jun 14 00:41:06 2007 +0900
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Sun Jun 17 15:01:54 2007 -0500

    [SCSI] i2o: convert to use the data buffer accessors
    
    - remove the unnecessary map_single path.
    
    - convert to use the new accessors for the sg lists and the
    parameters.
    
    Note: needs to change i2o_dma_map_sg when the chaining sg is ready.
    
    Signed-off-by: FUJITA Tomonori <[EMAIL PROTECTED]>
    Acked-by: "Salyzyn, Mark" <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 drivers/message/i2o/i2o_scsi.c |   24 +++++++-----------------
 1 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/drivers/message/i2o/i2o_scsi.c b/drivers/message/i2o/i2o_scsi.c
index 1045c8a..aa6fb94 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,
                osm_err("SCSI error %08x\n", error);
 
        dev = &c->pdev->dev;
-       if (cmd->use_sg)
-               dma_unmap_sg(dev, cmd->request_buffer, cmd->use_sg,
-                            cmd->sc_data_direction);
-       else if (cmd->SCp.dma_handle)
-               dma_unmap_single(dev, cmd->SCp.dma_handle, cmd->request_bufflen,
-                                cmd->sc_data_direction);
+
+       scsi_dma_unmap(cmd);
 
        cmd->scsi_done(cmd);
 
@@ -664,21 +660,15 @@ static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt,
 
        if (sgl_offset != SGL_OFFSET_0) {
                /* write size of data addressed by SGL */
-               *mptr++ = cpu_to_le32(SCpnt->request_bufflen);
+               *mptr++ = cpu_to_le32(scsi_bufflen(SCpnt));
 
                /* Now fill in the SGList and command */
-               if (SCpnt->use_sg) {
-                       if (!i2o_dma_map_sg(c, SCpnt->request_buffer,
-                                           SCpnt->use_sg,
+
+               if (scsi_sg_count(SCpnt)) {
+                       if (!i2o_dma_map_sg(c, scsi_sglist(SCpnt),
+                                           scsi_sg_count(SCpnt),
                                            SCpnt->sc_data_direction, &mptr))
                                goto nomem;
-               } else {
-                       SCpnt->SCp.dma_handle =
-                           i2o_dma_map_single(c, SCpnt->request_buffer,
-                                              SCpnt->request_bufflen,
-                                              SCpnt->sc_data_direction, &mptr);
-                       if (dma_mapping_error(SCpnt->SCp.dma_handle))
-                               goto nomem;
                }
        }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to