aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2007-05-31 14:12:32 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-05-31 17:30:04 -0400
commit2b14ec787869707843a14164a3ba91930a076031 (patch)
tree1e065bdbf2ed30c7a9b3f7eecc4805b79649cd02 /drivers/scsi
parentbcd92c9fbcc679ee95003083056f0441a1f474fa (diff)
[SCSI] esp: use shost_priv
Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: David Miller <davem@davemloft.net> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/esp_scsi.c20
-rw-r--r--drivers/scsi/esp_scsi.h2
-rw-r--r--drivers/scsi/jazz_esp.c2
-rw-r--r--drivers/scsi/sun_esp.c2
4 files changed, 12 insertions, 14 deletions
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)
921static int esp_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) 921static int esp_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
922{ 922{
923 struct scsi_device *dev = cmd->device; 923 struct scsi_device *dev = cmd->device;
924 struct esp *esp = host_to_esp(dev->host); 924 struct esp *esp = shost_priv(dev->host);
925 struct esp_cmd_priv *spriv; 925 struct esp_cmd_priv *spriv;
926 struct esp_cmd_entry *ent; 926 struct esp_cmd_entry *ent;
927 927
@@ -2356,7 +2356,7 @@ EXPORT_SYMBOL(scsi_esp_unregister);
2356 2356
2357static int esp_slave_alloc(struct scsi_device *dev) 2357static int esp_slave_alloc(struct scsi_device *dev)
2358{ 2358{
2359 struct esp *esp = host_to_esp(dev->host); 2359 struct esp *esp = shost_priv(dev->host);
2360 struct esp_target_data *tp = &esp->target[dev->id]; 2360 struct esp_target_data *tp = &esp->target[dev->id];
2361 struct esp_lun_data *lp; 2361 struct esp_lun_data *lp;
2362 2362
@@ -2380,7 +2380,7 @@ static int esp_slave_alloc(struct scsi_device *dev)
2380 2380
2381static int esp_slave_configure(struct scsi_device *dev) 2381static int esp_slave_configure(struct scsi_device *dev)
2382{ 2382{
2383 struct esp *esp = host_to_esp(dev->host); 2383 struct esp *esp = shost_priv(dev->host);
2384 struct esp_target_data *tp = &esp->target[dev->id]; 2384 struct esp_target_data *tp = &esp->target[dev->id];
2385 int goal_tags, queue_depth; 2385 int goal_tags, queue_depth;
2386 2386
@@ -2422,7 +2422,7 @@ static void esp_slave_destroy(struct scsi_device *dev)
2422 2422
2423static int esp_eh_abort_handler(struct scsi_cmnd *cmd) 2423static int esp_eh_abort_handler(struct scsi_cmnd *cmd)
2424{ 2424{
2425 struct esp *esp = host_to_esp(cmd->device->host); 2425 struct esp *esp = shost_priv(cmd->device->host);
2426 struct esp_cmd_entry *ent, *tmp; 2426 struct esp_cmd_entry *ent, *tmp;
2427 struct completion eh_done; 2427 struct completion eh_done;
2428 unsigned long flags; 2428 unsigned long flags;
@@ -2538,7 +2538,7 @@ out_failure:
2538 2538
2539static int esp_eh_bus_reset_handler(struct scsi_cmnd *cmd) 2539static int esp_eh_bus_reset_handler(struct scsi_cmnd *cmd)
2540{ 2540{
2541 struct esp *esp = host_to_esp(cmd->device->host); 2541 struct esp *esp = shost_priv(cmd->device->host);
2542 struct completion eh_reset; 2542 struct completion eh_reset;
2543 unsigned long flags; 2543 unsigned long flags;
2544 2544
@@ -2574,7 +2574,7 @@ static int esp_eh_bus_reset_handler(struct scsi_cmnd *cmd)
2574/* All bets are off, reset the entire device. */ 2574/* All bets are off, reset the entire device. */
2575static int esp_eh_host_reset_handler(struct scsi_cmnd *cmd) 2575static int esp_eh_host_reset_handler(struct scsi_cmnd *cmd)
2576{ 2576{
2577 struct esp *esp = host_to_esp(cmd->device->host); 2577 struct esp *esp = shost_priv(cmd->device->host);
2578 unsigned long flags; 2578 unsigned long flags;
2579 2579
2580 spin_lock_irqsave(esp->host->host_lock, flags); 2580 spin_lock_irqsave(esp->host->host_lock, flags);
@@ -2614,7 +2614,7 @@ EXPORT_SYMBOL(scsi_esp_template);
2614 2614
2615static void esp_get_signalling(struct Scsi_Host *host) 2615static void esp_get_signalling(struct Scsi_Host *host)
2616{ 2616{
2617 struct esp *esp = host_to_esp(host); 2617 struct esp *esp = shost_priv(host);
2618 enum spi_signal_type type; 2618 enum spi_signal_type type;
2619 2619
2620 if (esp->flags & ESP_FLAG_DIFFERENTIAL) 2620 if (esp->flags & ESP_FLAG_DIFFERENTIAL)
@@ -2628,7 +2628,7 @@ static void esp_get_signalling(struct Scsi_Host *host)
2628static void esp_set_offset(struct scsi_target *target, int offset) 2628static void esp_set_offset(struct scsi_target *target, int offset)
2629{ 2629{
2630 struct Scsi_Host *host = dev_to_shost(target->dev.parent); 2630 struct Scsi_Host *host = dev_to_shost(target->dev.parent);
2631 struct esp *esp = host_to_esp(host); 2631 struct esp *esp = shost_priv(host);
2632 struct esp_target_data *tp = &esp->target[target->id]; 2632 struct esp_target_data *tp = &esp->target[target->id];
2633 2633
2634 tp->nego_goal_offset = offset; 2634 tp->nego_goal_offset = offset;
@@ -2638,7 +2638,7 @@ static void esp_set_offset(struct scsi_target *target, int offset)
2638static void esp_set_period(struct scsi_target *target, int period) 2638static void esp_set_period(struct scsi_target *target, int period)
2639{ 2639{
2640 struct Scsi_Host *host = dev_to_shost(target->dev.parent); 2640 struct Scsi_Host *host = dev_to_shost(target->dev.parent);
2641 struct esp *esp = host_to_esp(host); 2641 struct esp *esp = shost_priv(host);
2642 struct esp_target_data *tp = &esp->target[target->id]; 2642 struct esp_target_data *tp = &esp->target[target->id];
2643 2643
2644 tp->nego_goal_period = period; 2644 tp->nego_goal_period = period;
@@ -2648,7 +2648,7 @@ static void esp_set_period(struct scsi_target *target, int period)
2648static void esp_set_width(struct scsi_target *target, int width) 2648static void esp_set_width(struct scsi_target *target, int width)
2649{ 2649{
2650 struct Scsi_Host *host = dev_to_shost(target->dev.parent); 2650 struct Scsi_Host *host = dev_to_shost(target->dev.parent);
2651 struct esp *esp = host_to_esp(host); 2651 struct esp *esp = shost_priv(host);
2652 struct esp_target_data *tp = &esp->target[target->id]; 2652 struct esp_target_data *tp = &esp->target[target->id];
2653 2653
2654 tp->nego_goal_width = (width ? 1 : 0); 2654 tp->nego_goal_width = (width ? 1 : 0);
diff --git a/drivers/scsi/esp_scsi.h b/drivers/scsi/esp_scsi.h
index 8d4a6690401f..d5576d54ce76 100644
--- a/drivers/scsi/esp_scsi.h
+++ b/drivers/scsi/esp_scsi.h
@@ -517,8 +517,6 @@ struct esp {
517 struct sbus_dma *dma; 517 struct sbus_dma *dma;
518}; 518};
519 519
520#define host_to_esp(host) ((struct esp *)(host)->hostdata)
521
522/* A front-end driver for the ESP chip should do the following in 520/* A front-end driver for the ESP chip should do the following in
523 * it's device probe routine: 521 * it's device probe routine:
524 * 1) Allocate the host and private area using scsi_host_alloc() 522 * 1) Allocate the host and private area using scsi_host_alloc()
diff --git a/drivers/scsi/jazz_esp.c b/drivers/scsi/jazz_esp.c
index 0140766c0286..5d231015bb20 100644
--- a/drivers/scsi/jazz_esp.c
+++ b/drivers/scsi/jazz_esp.c
@@ -143,7 +143,7 @@ static int __devinit esp_jazz_probe(struct platform_device *dev)
143 goto fail; 143 goto fail;
144 144
145 host->max_id = 8; 145 host->max_id = 8;
146 esp = host_to_esp(host); 146 esp = shost_priv(host);
147 147
148 esp->host = host; 148 esp->host = host;
149 esp->dev = dev; 149 esp->dev = dev;
diff --git a/drivers/scsi/sun_esp.c b/drivers/scsi/sun_esp.c
index bbeb2451d32f..2c87db98cdfb 100644
--- a/drivers/scsi/sun_esp.c
+++ b/drivers/scsi/sun_esp.c
@@ -493,7 +493,7 @@ static int __devinit esp_sbus_probe_one(struct device *dev,
493 goto fail; 493 goto fail;
494 494
495 host->max_id = (hme ? 16 : 8); 495 host->max_id = (hme ? 16 : 8);
496 esp = host_to_esp(host); 496 esp = shost_priv(host);
497 497
498 esp->host = host; 498 esp->host = host;
499 esp->dev = esp_dev; 499 esp->dev = esp_dev;