Commit 2b14ec78 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by James Bottomley

[SCSI] esp: use shost_priv

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarDavid Miller <davem@davemloft.net>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent bcd92c9f
...@@ -921,7 +921,7 @@ static void esp_event_queue_full(struct esp *esp, struct esp_cmd_entry *ent) ...@@ -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 *)) static int esp_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
{ {
struct scsi_device *dev = cmd->device; 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_priv *spriv;
struct esp_cmd_entry *ent; struct esp_cmd_entry *ent;
...@@ -2356,7 +2356,7 @@ EXPORT_SYMBOL(scsi_esp_unregister); ...@@ -2356,7 +2356,7 @@ EXPORT_SYMBOL(scsi_esp_unregister);
static int esp_slave_alloc(struct scsi_device *dev) 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_target_data *tp = &esp->target[dev->id];
struct esp_lun_data *lp; struct esp_lun_data *lp;
...@@ -2380,7 +2380,7 @@ static int esp_slave_alloc(struct scsi_device *dev) ...@@ -2380,7 +2380,7 @@ static int esp_slave_alloc(struct scsi_device *dev)
static int esp_slave_configure(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]; struct esp_target_data *tp = &esp->target[dev->id];
int goal_tags, queue_depth; int goal_tags, queue_depth;
...@@ -2422,7 +2422,7 @@ static void esp_slave_destroy(struct scsi_device *dev) ...@@ -2422,7 +2422,7 @@ static void esp_slave_destroy(struct scsi_device *dev)
static int esp_eh_abort_handler(struct scsi_cmnd *cmd) 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 esp_cmd_entry *ent, *tmp;
struct completion eh_done; struct completion eh_done;
unsigned long flags; unsigned long flags;
...@@ -2538,7 +2538,7 @@ out_failure: ...@@ -2538,7 +2538,7 @@ out_failure:
static int esp_eh_bus_reset_handler(struct scsi_cmnd *cmd) 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; struct completion eh_reset;
unsigned long flags; unsigned long flags;
...@@ -2574,7 +2574,7 @@ static int esp_eh_bus_reset_handler(struct scsi_cmnd *cmd) ...@@ -2574,7 +2574,7 @@ static int esp_eh_bus_reset_handler(struct scsi_cmnd *cmd)
/* All bets are off, reset the entire device. */ /* All bets are off, reset the entire device. */
static int esp_eh_host_reset_handler(struct scsi_cmnd *cmd) 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; unsigned long flags;
spin_lock_irqsave(esp->host->host_lock, flags); spin_lock_irqsave(esp->host->host_lock, flags);
...@@ -2614,7 +2614,7 @@ EXPORT_SYMBOL(scsi_esp_template); ...@@ -2614,7 +2614,7 @@ EXPORT_SYMBOL(scsi_esp_template);
static void esp_get_signalling(struct Scsi_Host *host) 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; enum spi_signal_type type;
if (esp->flags & ESP_FLAG_DIFFERENTIAL) if (esp->flags & ESP_FLAG_DIFFERENTIAL)
...@@ -2628,7 +2628,7 @@ static void esp_get_signalling(struct Scsi_Host *host) ...@@ -2628,7 +2628,7 @@ static void esp_get_signalling(struct Scsi_Host *host)
static void esp_set_offset(struct scsi_target *target, int offset) static void esp_set_offset(struct scsi_target *target, int offset)
{ {
struct Scsi_Host *host = dev_to_shost(target->dev.parent); 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]; struct esp_target_data *tp = &esp->target[target->id];
tp->nego_goal_offset = offset; tp->nego_goal_offset = offset;
...@@ -2638,7 +2638,7 @@ static void esp_set_offset(struct scsi_target *target, int 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) static void esp_set_period(struct scsi_target *target, int period)
{ {
struct Scsi_Host *host = dev_to_shost(target->dev.parent); 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]; struct esp_target_data *tp = &esp->target[target->id];
tp->nego_goal_period = period; tp->nego_goal_period = period;
...@@ -2648,7 +2648,7 @@ static void esp_set_period(struct scsi_target *target, int 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) static void esp_set_width(struct scsi_target *target, int width)
{ {
struct Scsi_Host *host = dev_to_shost(target->dev.parent); 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]; struct esp_target_data *tp = &esp->target[target->id];
tp->nego_goal_width = (width ? 1 : 0); tp->nego_goal_width = (width ? 1 : 0);
......
...@@ -517,8 +517,6 @@ struct esp { ...@@ -517,8 +517,6 @@ struct esp {
struct sbus_dma *dma; struct sbus_dma *dma;
}; };
#define host_to_esp(host) ((struct esp *)(host)->hostdata)
/* A front-end driver for the ESP chip should do the following in /* A front-end driver for the ESP chip should do the following in
* it's device probe routine: * it's device probe routine:
* 1) Allocate the host and private area using scsi_host_alloc() * 1) Allocate the host and private area using scsi_host_alloc()
......
...@@ -143,7 +143,7 @@ static int __devinit esp_jazz_probe(struct platform_device *dev) ...@@ -143,7 +143,7 @@ static int __devinit esp_jazz_probe(struct platform_device *dev)
goto fail; goto fail;
host->max_id = 8; host->max_id = 8;
esp = host_to_esp(host); esp = shost_priv(host);
esp->host = host; esp->host = host;
esp->dev = dev; esp->dev = dev;
......
...@@ -493,7 +493,7 @@ static int __devinit esp_sbus_probe_one(struct device *dev, ...@@ -493,7 +493,7 @@ static int __devinit esp_sbus_probe_one(struct device *dev,
goto fail; goto fail;
host->max_id = (hme ? 16 : 8); host->max_id = (hme ? 16 : 8);
esp = host_to_esp(host); esp = shost_priv(host);
esp->host = host; esp->host = host;
esp->dev = esp_dev; esp->dev = esp_dev;
......
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