Commit 4c2baaaf authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by James Bottomley

[SCSI] esp_scsi: convert to use the data buffer accessors

- convert to use the new accessors for the sg lists and the
parameters.
Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent f9875496
...@@ -324,17 +324,14 @@ static void esp_reset_esp(struct esp *esp) ...@@ -324,17 +324,14 @@ static void esp_reset_esp(struct esp *esp)
static void esp_map_dma(struct esp *esp, struct scsi_cmnd *cmd) static void esp_map_dma(struct esp *esp, struct scsi_cmnd *cmd)
{ {
struct esp_cmd_priv *spriv = ESP_CMD_PRIV(cmd); struct esp_cmd_priv *spriv = ESP_CMD_PRIV(cmd);
struct scatterlist *sg = cmd->request_buffer; struct scatterlist *sg = scsi_sglist(cmd);
int dir = cmd->sc_data_direction; int dir = cmd->sc_data_direction;
int total, i; int total, i;
if (dir == DMA_NONE) if (dir == DMA_NONE)
return; return;
BUG_ON(cmd->use_sg == 0); spriv->u.num_sg = esp->ops->map_sg(esp, sg, scsi_sg_count(cmd), dir);
spriv->u.num_sg = esp->ops->map_sg(esp, sg,
cmd->use_sg, dir);
spriv->cur_residue = sg_dma_len(sg); spriv->cur_residue = sg_dma_len(sg);
spriv->cur_sg = sg; spriv->cur_sg = sg;
...@@ -407,8 +404,7 @@ static void esp_unmap_dma(struct esp *esp, struct scsi_cmnd *cmd) ...@@ -407,8 +404,7 @@ static void esp_unmap_dma(struct esp *esp, struct scsi_cmnd *cmd)
if (dir == DMA_NONE) if (dir == DMA_NONE)
return; return;
esp->ops->unmap_sg(esp, cmd->request_buffer, esp->ops->unmap_sg(esp, scsi_sglist(cmd), spriv->u.num_sg, dir);
spriv->u.num_sg, dir);
} }
static void esp_save_pointers(struct esp *esp, struct esp_cmd_entry *ent) static void esp_save_pointers(struct esp *esp, struct esp_cmd_entry *ent)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment