From 2b14ec787869707843a14164a3ba91930a076031 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 31 May 2007 20:12:32 +0200 Subject: [SCSI] esp: use shost_priv Signed-off-by: Christoph Hellwig Acked-by: David Miller Signed-off-by: James Bottomley --- drivers/scsi/esp_scsi.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'drivers/scsi/esp_scsi.c') diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c index ec71061aef61..2321f3db4623 100644 --- a/drivers/scsi/esp_scsi.c +++ b/drivers/scsi/esp_scsi.c @@ -921,7 +921,7 @@ static void esp_event_queue_full(struct esp *esp, struct esp_cmd_entry *ent) static int esp_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) { struct scsi_device *dev = cmd->device; - struct esp *esp = host_to_esp(dev->host); + struct esp *esp = shost_priv(dev->host); struct esp_cmd_priv *spriv; struct esp_cmd_entry *ent; @@ -2356,7 +2356,7 @@ EXPORT_SYMBOL(scsi_esp_unregister); static int esp_slave_alloc(struct scsi_device *dev) { - struct esp *esp = host_to_esp(dev->host); + struct esp *esp = shost_priv(dev->host); struct esp_target_data *tp = &esp->target[dev->id]; struct esp_lun_data *lp; @@ -2380,7 +2380,7 @@ static int esp_slave_alloc(struct scsi_device *dev) static int esp_slave_configure(struct scsi_device *dev) { - struct esp *esp = host_to_esp(dev->host); + struct esp *esp = shost_priv(dev->host); struct esp_target_data *tp = &esp->target[dev->id]; int goal_tags, queue_depth; @@ -2422,7 +2422,7 @@ static void esp_slave_destroy(struct scsi_device *dev) static int esp_eh_abort_handler(struct scsi_cmnd *cmd) { - struct esp *esp = host_to_esp(cmd->device->host); + struct esp *esp = shost_priv(cmd->device->host); struct esp_cmd_entry *ent, *tmp; struct completion eh_done; unsigned long flags; @@ -2538,7 +2538,7 @@ out_failure: static int esp_eh_bus_reset_handler(struct scsi_cmnd *cmd) { - struct esp *esp = host_to_esp(cmd->device->host); + struct esp *esp = shost_priv(cmd->device->host); struct completion eh_reset; unsigned long flags; @@ -2574,7 +2574,7 @@ static int esp_eh_bus_reset_handler(struct scsi_cmnd *cmd) /* All bets are off, reset the entire device. */ static int esp_eh_host_reset_handler(struct scsi_cmnd *cmd) { - struct esp *esp = host_to_esp(cmd->device->host); + struct esp *esp = shost_priv(cmd->device->host); unsigned long flags; spin_lock_irqsave(esp->host->host_lock, flags); @@ -2614,7 +2614,7 @@ EXPORT_SYMBOL(scsi_esp_template); static void esp_get_signalling(struct Scsi_Host *host) { - struct esp *esp = host_to_esp(host); + struct esp *esp = shost_priv(host); enum spi_signal_type type; if (esp->flags & ESP_FLAG_DIFFERENTIAL) @@ -2628,7 +2628,7 @@ static void esp_get_signalling(struct Scsi_Host *host) static void esp_set_offset(struct scsi_target *target, int offset) { struct Scsi_Host *host = dev_to_shost(target->dev.parent); - struct esp *esp = host_to_esp(host); + struct esp *esp = shost_priv(host); struct esp_target_data *tp = &esp->target[target->id]; tp->nego_goal_offset = offset; @@ -2638,7 +2638,7 @@ static void esp_set_offset(struct scsi_target *target, int offset) static void esp_set_period(struct scsi_target *target, int period) { struct Scsi_Host *host = dev_to_shost(target->dev.parent); - struct esp *esp = host_to_esp(host); + struct esp *esp = shost_priv(host); struct esp_target_data *tp = &esp->target[target->id]; tp->nego_goal_period = period; @@ -2648,7 +2648,7 @@ static void esp_set_period(struct scsi_target *target, int period) static void esp_set_width(struct scsi_target *target, int width) { struct Scsi_Host *host = dev_to_shost(target->dev.parent); - struct esp *esp = host_to_esp(host); + struct esp *esp = shost_priv(host); struct esp_target_data *tp = &esp->target[target->id]; tp->nego_goal_width = (width ? 1 : 0); -- cgit v1.2.3 From 4c2baaaf2ba4875d1d2d59b3b3e1216d3277b17a Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Sat, 26 May 2007 04:51:32 +0900 Subject: [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: FUJITA Tomonori Cc: David Miller Signed-off-by: James Bottomley --- drivers/scsi/esp_scsi.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'drivers/scsi/esp_scsi.c') diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c index 2321f3db4623..c1d50e669c43 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) static void esp_map_dma(struct esp *esp, struct scsi_cmnd *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 total, i; if (dir == DMA_NONE) return; - BUG_ON(cmd->use_sg == 0); - - spriv->u.num_sg = esp->ops->map_sg(esp, sg, - cmd->use_sg, dir); + spriv->u.num_sg = esp->ops->map_sg(esp, sg, scsi_sg_count(cmd), dir); spriv->cur_residue = sg_dma_len(sg); spriv->cur_sg = sg; @@ -407,8 +404,7 @@ static void esp_unmap_dma(struct esp *esp, struct scsi_cmnd *cmd) if (dir == DMA_NONE) return; - esp->ops->unmap_sg(esp, cmd->request_buffer, - spriv->u.num_sg, dir); + esp->ops->unmap_sg(esp, scsi_sglist(cmd), spriv->u.num_sg, dir); } static void esp_save_pointers(struct esp *esp, struct esp_cmd_entry *ent) -- cgit v1.2.3