aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sym53c8xx_2/sym_fw.c
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2007-10-05 15:55:13 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-10-23 15:26:34 -0400
commit5111eefa17615bdf17ca00ec2cdca16302c7697e (patch)
tree99fe4783b42b7b3a35f7962705e8002643651b16 /drivers/scsi/sym53c8xx_2/sym_fw.c
parent99c9e0a1d6cfe1ba1169a7a81435ee85bc00e4a1 (diff)
[SCSI] sym53c8xx: Remove pci_dev pointer from sym_shcb
This structure is accessed by the device; the fewer Linux things in it, the better. Using the pci_dev pointer from the hostdata requires a lot of changes: - Pass Scsi_Host to a lot of routines which currently take a sym_hcb. - Set the Scsi_Host as the pci drvdata (instead of the sym_hcb) Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/sym53c8xx_2/sym_fw.c')
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_fw.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/scsi/sym53c8xx_2/sym_fw.c b/drivers/scsi/sym53c8xx_2/sym_fw.c
index aa230d23eda4..190770bdc194 100644
--- a/drivers/scsi/sym53c8xx_2/sym_fw.c
+++ b/drivers/scsi/sym53c8xx_2/sym_fw.c
@@ -104,8 +104,9 @@ static struct sym_fwz_ofs sym_fw2z_ofs = {
104 * Patch routine for firmware #1. 104 * Patch routine for firmware #1.
105 */ 105 */
106static void 106static void
107sym_fw1_patch(struct sym_hcb *np) 107sym_fw1_patch(struct Scsi_Host *shost)
108{ 108{
109 struct sym_hcb *np = sym_get_hcb(shost);
109 struct sym_fw1a_scr *scripta0; 110 struct sym_fw1a_scr *scripta0;
110 struct sym_fw1b_scr *scriptb0; 111 struct sym_fw1b_scr *scriptb0;
111 112
@@ -145,8 +146,11 @@ sym_fw1_patch(struct sym_hcb *np)
145 * Patch routine for firmware #2. 146 * Patch routine for firmware #2.
146 */ 147 */
147static void 148static void
148sym_fw2_patch(struct sym_hcb *np) 149sym_fw2_patch(struct Scsi_Host *shost)
149{ 150{
151 struct sym_data *sym_data = shost_priv(shost);
152 struct pci_dev *pdev = sym_data->pdev;
153 struct sym_hcb *np = sym_data->ncb;
150 struct sym_fw2a_scr *scripta0; 154 struct sym_fw2a_scr *scripta0;
151 struct sym_fw2b_scr *scriptb0; 155 struct sym_fw2b_scr *scriptb0;
152 156
@@ -205,14 +209,14 @@ sym_fw2_patch(struct sym_hcb *np)
205 * Remove a couple of work-arounds specific to C1010 if 209 * Remove a couple of work-arounds specific to C1010 if
206 * they are not desirable. See `sym_fw2.h' for more details. 210 * they are not desirable. See `sym_fw2.h' for more details.
207 */ 211 */
208 if (!(np->s.device->device == PCI_DEVICE_ID_LSI_53C1010_66 && 212 if (!(pdev->device == PCI_DEVICE_ID_LSI_53C1010_66 &&
209 np->s.device->revision < 0x1 && 213 pdev->revision < 0x1 &&
210 np->pciclk_khz < 60000)) { 214 np->pciclk_khz < 60000)) {
211 scripta0->datao_phase[0] = cpu_to_scr(SCR_NO_OP); 215 scripta0->datao_phase[0] = cpu_to_scr(SCR_NO_OP);
212 scripta0->datao_phase[1] = cpu_to_scr(0); 216 scripta0->datao_phase[1] = cpu_to_scr(0);
213 } 217 }
214 if (!(np->s.device->device == PCI_DEVICE_ID_LSI_53C1010_33 /* && 218 if (!(pdev->device == PCI_DEVICE_ID_LSI_53C1010_33 /* &&
215 np->s.device->revision < 0xff */)) { 219 pdev->revision < 0xff */)) {
216 scripta0->sel_done[0] = cpu_to_scr(SCR_NO_OP); 220 scripta0->sel_done[0] = cpu_to_scr(SCR_NO_OP);
217 scripta0->sel_done[1] = cpu_to_scr(0); 221 scripta0->sel_done[1] = cpu_to_scr(0);
218 } 222 }