diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2016-01-03 00:05:54 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-01-06 21:43:06 -0500 |
commit | e8a601444297e336a7c4355f07b4bb386962894c (patch) | |
tree | 73f18e5f2af6c5d3f200643354292990906e0630 /drivers/scsi/NCR5380.c | |
parent | dbb6b350695186b340e621f5edf4c31420f9ab23 (diff) |
ncr5380: Use shost_priv helper
Make use of the shost_priv() helper. Remove HOSTDATA and SETUP_HOSTDATA
macros because they harm readability.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Tested-by: Ondrej Zary <linux@rainbow-software.org>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/NCR5380.c')
-rw-r--r-- | drivers/scsi/NCR5380.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index 54939836ca53..3774adb3e75a 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c | |||
@@ -464,7 +464,7 @@ static irqreturn_t __init probe_intr(int irq, void *dev_id) | |||
464 | static int __init __maybe_unused NCR5380_probe_irq(struct Scsi_Host *instance, | 464 | static int __init __maybe_unused NCR5380_probe_irq(struct Scsi_Host *instance, |
465 | int possible) | 465 | int possible) |
466 | { | 466 | { |
467 | struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; | 467 | struct NCR5380_hostdata *hostdata = shost_priv(instance); |
468 | unsigned long timeout; | 468 | unsigned long timeout; |
469 | int trying_irqs, i, mask; | 469 | int trying_irqs, i, mask; |
470 | 470 | ||
@@ -586,9 +586,7 @@ static int __maybe_unused NCR5380_write_info(struct Scsi_Host *instance, | |||
586 | static int __maybe_unused NCR5380_show_info(struct seq_file *m, | 586 | static int __maybe_unused NCR5380_show_info(struct seq_file *m, |
587 | struct Scsi_Host *instance) | 587 | struct Scsi_Host *instance) |
588 | { | 588 | { |
589 | struct NCR5380_hostdata *hostdata; | 589 | struct NCR5380_hostdata *hostdata = shost_priv(instance); |
590 | |||
591 | hostdata = (struct NCR5380_hostdata *) instance->hostdata; | ||
592 | 590 | ||
593 | seq_printf(m, "Highwater I/O busy spin counts: write %d, read %d\n", | 591 | seq_printf(m, "Highwater I/O busy spin counts: write %d, read %d\n", |
594 | hostdata->spin_max_w, hostdata->spin_max_r); | 592 | hostdata->spin_max_w, hostdata->spin_max_r); |
@@ -614,8 +612,8 @@ static int __maybe_unused NCR5380_show_info(struct seq_file *m, | |||
614 | 612 | ||
615 | static int NCR5380_init(struct Scsi_Host *instance, int flags) | 613 | static int NCR5380_init(struct Scsi_Host *instance, int flags) |
616 | { | 614 | { |
615 | struct NCR5380_hostdata *hostdata = shost_priv(instance); | ||
617 | int i; | 616 | int i; |
618 | struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; | ||
619 | unsigned long deadline; | 617 | unsigned long deadline; |
620 | 618 | ||
621 | if(in_interrupt()) | 619 | if(in_interrupt()) |
@@ -728,7 +726,7 @@ static int NCR5380_maybe_reset_bus(struct Scsi_Host *instance) | |||
728 | 726 | ||
729 | static void NCR5380_exit(struct Scsi_Host *instance) | 727 | static void NCR5380_exit(struct Scsi_Host *instance) |
730 | { | 728 | { |
731 | struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; | 729 | struct NCR5380_hostdata *hostdata = shost_priv(instance); |
732 | 730 | ||
733 | cancel_work_sync(&hostdata->main_task); | 731 | cancel_work_sync(&hostdata->main_task); |
734 | destroy_workqueue(hostdata->work_q); | 732 | destroy_workqueue(hostdata->work_q); |
@@ -1037,7 +1035,7 @@ static irqreturn_t NCR5380_intr(int irq, void *dev_id) | |||
1037 | 1035 | ||
1038 | static int NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd) | 1036 | static int NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd) |
1039 | { | 1037 | { |
1040 | struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; | 1038 | struct NCR5380_hostdata *hostdata = shost_priv(instance); |
1041 | unsigned char tmp[3], phase; | 1039 | unsigned char tmp[3], phase; |
1042 | unsigned char *data; | 1040 | unsigned char *data; |
1043 | int len; | 1041 | int len; |
@@ -1511,7 +1509,7 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase | |||
1511 | unsigned char saved_data = 0, overrun = 0, residue; | 1509 | unsigned char saved_data = 0, overrun = 0, residue; |
1512 | #endif | 1510 | #endif |
1513 | 1511 | ||
1514 | struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; | 1512 | struct NCR5380_hostdata *hostdata = shost_priv(instance); |
1515 | 1513 | ||
1516 | if ((tmp = (NCR5380_read(STATUS_REG) & PHASE_MASK)) != p) { | 1514 | if ((tmp = (NCR5380_read(STATUS_REG) & PHASE_MASK)) != p) { |
1517 | *phase = tmp; | 1515 | *phase = tmp; |
@@ -1743,7 +1741,7 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase | |||
1743 | */ | 1741 | */ |
1744 | 1742 | ||
1745 | static void NCR5380_information_transfer(struct Scsi_Host *instance) { | 1743 | static void NCR5380_information_transfer(struct Scsi_Host *instance) { |
1746 | struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *)instance->hostdata; | 1744 | struct NCR5380_hostdata *hostdata = shost_priv(instance); |
1747 | unsigned char msgout = NOP; | 1745 | unsigned char msgout = NOP; |
1748 | int sink = 0; | 1746 | int sink = 0; |
1749 | int len; | 1747 | int len; |
@@ -2090,8 +2088,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { | |||
2090 | */ | 2088 | */ |
2091 | 2089 | ||
2092 | static void NCR5380_reselect(struct Scsi_Host *instance) { | 2090 | static void NCR5380_reselect(struct Scsi_Host *instance) { |
2093 | struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) | 2091 | struct NCR5380_hostdata *hostdata = shost_priv(instance); |
2094 | instance->hostdata; | ||
2095 | unsigned char target_mask; | 2092 | unsigned char target_mask; |
2096 | unsigned char lun, phase; | 2093 | unsigned char lun, phase; |
2097 | int len; | 2094 | int len; |
@@ -2214,7 +2211,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) { | |||
2214 | 2211 | ||
2215 | #ifdef REAL_DMA | 2212 | #ifdef REAL_DMA |
2216 | static void NCR5380_dma_complete(NCR5380_instance * instance) { | 2213 | static void NCR5380_dma_complete(NCR5380_instance * instance) { |
2217 | struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; | 2214 | struct NCR5380_hostdata *hostdata = shost_priv(instance); |
2218 | int transferred; | 2215 | int transferred; |
2219 | 2216 | ||
2220 | /* | 2217 | /* |
@@ -2268,7 +2265,7 @@ static void NCR5380_dma_complete(NCR5380_instance * instance) { | |||
2268 | static int NCR5380_abort(struct scsi_cmnd *cmd) | 2265 | static int NCR5380_abort(struct scsi_cmnd *cmd) |
2269 | { | 2266 | { |
2270 | struct Scsi_Host *instance = cmd->device->host; | 2267 | struct Scsi_Host *instance = cmd->device->host; |
2271 | struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; | 2268 | struct NCR5380_hostdata *hostdata = shost_priv(instance); |
2272 | struct scsi_cmnd *tmp, **prev; | 2269 | struct scsi_cmnd *tmp, **prev; |
2273 | unsigned long flags; | 2270 | unsigned long flags; |
2274 | 2271 | ||