From 5111eefa17615bdf17ca00ec2cdca16302c7697e Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Fri, 5 Oct 2007 15:55:13 -0400 Subject: [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 Signed-off-by: James Bottomley --- drivers/scsi/sym53c8xx_2/sym_fw.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'drivers/scsi/sym53c8xx_2/sym_fw.c') 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 = { * Patch routine for firmware #1. */ static void -sym_fw1_patch(struct sym_hcb *np) +sym_fw1_patch(struct Scsi_Host *shost) { + struct sym_hcb *np = sym_get_hcb(shost); struct sym_fw1a_scr *scripta0; struct sym_fw1b_scr *scriptb0; @@ -145,8 +146,11 @@ sym_fw1_patch(struct sym_hcb *np) * Patch routine for firmware #2. */ static void -sym_fw2_patch(struct sym_hcb *np) +sym_fw2_patch(struct Scsi_Host *shost) { + struct sym_data *sym_data = shost_priv(shost); + struct pci_dev *pdev = sym_data->pdev; + struct sym_hcb *np = sym_data->ncb; struct sym_fw2a_scr *scripta0; struct sym_fw2b_scr *scriptb0; @@ -205,14 +209,14 @@ sym_fw2_patch(struct sym_hcb *np) * Remove a couple of work-arounds specific to C1010 if * they are not desirable. See `sym_fw2.h' for more details. */ - if (!(np->s.device->device == PCI_DEVICE_ID_LSI_53C1010_66 && - np->s.device->revision < 0x1 && + if (!(pdev->device == PCI_DEVICE_ID_LSI_53C1010_66 && + pdev->revision < 0x1 && np->pciclk_khz < 60000)) { scripta0->datao_phase[0] = cpu_to_scr(SCR_NO_OP); scripta0->datao_phase[1] = cpu_to_scr(0); } - if (!(np->s.device->device == PCI_DEVICE_ID_LSI_53C1010_33 /* && - np->s.device->revision < 0xff */)) { + if (!(pdev->device == PCI_DEVICE_ID_LSI_53C1010_33 /* && + pdev->revision < 0xff */)) { scripta0->sel_done[0] = cpu_to_scr(SCR_NO_OP); scripta0->sel_done[1] = cpu_to_scr(0); } -- cgit v1.2.3