[SCSI] scsi_lib_dma: fix bug with dma maps on nested scsi objects
[linux-2.6.git] / drivers / scsi / scsi_lib_dma.c
index ac6855c..dcd1285 100644 (file)
@@ -23,7 +23,7 @@ int scsi_dma_map(struct scsi_cmnd *cmd)
        int nseg = 0;
 
        if (scsi_sg_count(cmd)) {
-               struct device *dev = cmd->device->host->shost_gendev.parent;
+               struct device *dev = cmd->device->host->dma_dev;
 
                nseg = dma_map_sg(dev, scsi_sglist(cmd), scsi_sg_count(cmd),
                                  cmd->sc_data_direction);
@@ -41,7 +41,7 @@ EXPORT_SYMBOL(scsi_dma_map);
 void scsi_dma_unmap(struct scsi_cmnd *cmd)
 {
        if (scsi_sg_count(cmd)) {
-               struct device *dev = cmd->device->host->shost_gendev.parent;
+               struct device *dev = cmd->device->host->dma_dev;
 
                dma_unmap_sg(dev, scsi_sglist(cmd), scsi_sg_count(cmd),
                             cmd->sc_data_direction);