aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/esp_scsi.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c
index 2321f3db462..c1d50e669c4 100644
--- a/drivers/scsi/esp_scsi.c
+++ b/drivers/scsi/esp_scsi.c
@@ -324,17 +324,14 @@ static void esp_reset_esp(struct esp *esp)
324static void esp_map_dma(struct esp *esp, struct scsi_cmnd *cmd) 324static void esp_map_dma(struct esp *esp, struct scsi_cmnd *cmd)
325{ 325{
326 struct esp_cmd_priv *spriv = ESP_CMD_PRIV(cmd); 326 struct esp_cmd_priv *spriv = ESP_CMD_PRIV(cmd);
327 struct scatterlist *sg = cmd->request_buffer; 327 struct scatterlist *sg = scsi_sglist(cmd);
328 int dir = cmd->sc_data_direction; 328 int dir = cmd->sc_data_direction;
329 int total, i; 329 int total, i;
330 330
331 if (dir == DMA_NONE) 331 if (dir == DMA_NONE)
332 return; 332 return;
333 333
334 BUG_ON(cmd->use_sg == 0); 334 spriv->u.num_sg = esp->ops->map_sg(esp, sg, scsi_sg_count(cmd), dir);
335
336 spriv->u.num_sg = esp->ops->map_sg(esp, sg,
337 cmd->use_sg, dir);
338 spriv->cur_residue = sg_dma_len(sg); 335 spriv->cur_residue = sg_dma_len(sg);
339 spriv->cur_sg = sg; 336 spriv->cur_sg = sg;
340 337
@@ -407,8 +404,7 @@ static void esp_unmap_dma(struct esp *esp, struct scsi_cmnd *cmd)
407 if (dir == DMA_NONE) 404 if (dir == DMA_NONE)
408 return; 405 return;
409 406
410 esp->ops->unmap_sg(esp, cmd->request_buffer, 407 esp->ops->unmap_sg(esp, scsi_sglist(cmd), spriv->u.num_sg, dir);
411 spriv->u.num_sg, dir);
412} 408}
413 409
414static void esp_save_pointers(struct esp *esp, struct esp_cmd_entry *ent) 410static void esp_save_pointers(struct esp *esp, struct esp_cmd_entry *ent)