[PATCH] SCSI: sgiwd93: remove use of legacy base field of host struct

Ralf Baechle
2010-04-23T11:08:39Z

---
Build tested only - I don't have a test system at hand atm.

drivers/scsi/sgiwd93.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/sgiwd93.c b/drivers/scsi/sgiwd93.c
index fef0e3c..1b24e8d 100644
--- a/drivers/scsi/sgiwd93.c
+++ b/drivers/scsi/sgiwd93.c
@@ -36,6 +36,7 @@ struct ip22_hostdata {
dma_addr_t dma;
void *cpu;
struct device *dev;
+ struct hpc3_scsiregs *hregs;
};

#define host_to_hostdata(host) ((struct ip22_hostdata *)((host)->hostdata))
@@ -103,8 +104,7 @@ void fill_hpc_entries(struct ip22_hostdata *hd, struct scsi_cmnd *cmd, int din)
static int dma_setup(struct scsi_cmnd *cmd, int datainp)
{
struct ip22_hostdata *hdata = host_to_hostdata(cmd->device->host);
- struct hpc3_scsiregs *hregs =
- (struct hpc3_scsiregs *) cmd->device->host->base;
+ struct hpc3_scsiregs *hregs = hdata->hregs;

pr_debug("dma_setup: datainp<%d> hcp<%p> ", datainp, hdata->cpu);

@@ -137,7 +137,7 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt,
int status)
{
struct ip22_hostdata *hdata = host_to_hostdata(instance);
- struct hpc3_scsiregs *hregs;
+ struct hpc3_scsiregs *hregs = hdata->hregs;

if (!SCpnt)
return;
@@ -145,8 +145,6 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt,
if (SCpnt->SCp.ptr == NULL || SCpnt->SCp.this_residual == 0)
return;

- hregs = (struct hpc3_scsiregs *) SCpnt->device->host->base;
-
pr_debug("dma_stop: status<%d> ", status);

/* First stop the HPC and flush it's FIFO. */
@@ -244,10 +242,10 @@ static int __devinit sgiwd93_probe(struct platform_device *pdev)
goto out;
}

- host->base = (unsigned long) hregs;
host->irq = irq;

hdata = host_to_hostdata(host);
+ hdata->hregs = hregs;
hdata->dev = &pdev->dev;
hdata->cpu = dma_alloc_noncoherent(&pdev->dev, HPC_DMA_SIZE,
&hdata->dma, GFP_KERNEL);