sparc: Make SBUS DMA interfaces take struct device.

This is the first step in converting all the SBUS drivers
over to generic dma_*().

Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c
index 4a1cf63..f010506 100644
--- a/drivers/scsi/qlogicpti.c
+++ b/drivers/scsi/qlogicpti.c
@@ -788,7 +788,7 @@
 	struct sbus_dev *sdev = qpti->sdev;
 
 #define QSIZE(entries)	(((entries) + 1) * QUEUE_ENTRY_LEN)
-	qpti->res_cpu = sbus_alloc_consistent(sdev,
+	qpti->res_cpu = sbus_alloc_consistent(&sdev->ofdev.dev,
 					      QSIZE(RES_QUEUE_LEN),
 					      &qpti->res_dvma);
 	if (qpti->res_cpu == NULL ||
@@ -797,12 +797,12 @@
 		return -1;
 	}
 
-	qpti->req_cpu = sbus_alloc_consistent(sdev,
+	qpti->req_cpu = sbus_alloc_consistent(&sdev->ofdev.dev,
 					      QSIZE(QLOGICPTI_REQ_QUEUE_LEN),
 					      &qpti->req_dvma);
 	if (qpti->req_cpu == NULL ||
 	    qpti->req_dvma == 0) {
-		sbus_free_consistent(sdev, QSIZE(RES_QUEUE_LEN),
+		sbus_free_consistent(&sdev->ofdev.dev, QSIZE(RES_QUEUE_LEN),
 				     qpti->res_cpu, qpti->res_dvma);
 		printk("QPTI: Cannot map request queue.\n");
 		return -1;
@@ -875,8 +875,9 @@
 		int sg_count;
 
 		sg = scsi_sglist(Cmnd);
-		sg_count = sbus_map_sg(qpti->sdev, sg, scsi_sg_count(Cmnd),
-		                                      Cmnd->sc_data_direction);
+		sg_count = sbus_map_sg(&qpti->sdev->ofdev.dev, sg,
+				       scsi_sg_count(Cmnd),
+				       Cmnd->sc_data_direction);
 
 		ds = cmd->dataseg;
 		cmd->segment_cnt = sg_count;
@@ -1151,7 +1152,7 @@
 			Cmnd->result = DID_ERROR << 16;
 
 		if (scsi_bufflen(Cmnd))
-			sbus_unmap_sg(qpti->sdev,
+			sbus_unmap_sg(&qpti->sdev->ofdev.dev,
 				      scsi_sglist(Cmnd), scsi_sg_count(Cmnd),
 				      Cmnd->sc_data_direction);
 
@@ -1356,10 +1357,10 @@
 
 fail_unmap_queues:
 #define QSIZE(entries)	(((entries) + 1) * QUEUE_ENTRY_LEN)
-	sbus_free_consistent(qpti->sdev,
+	sbus_free_consistent(&qpti->sdev->ofdev.dev,
 			     QSIZE(RES_QUEUE_LEN),
 			     qpti->res_cpu, qpti->res_dvma);
-	sbus_free_consistent(qpti->sdev,
+	sbus_free_consistent(&qpti->sdev->ofdev.dev,
 			     QSIZE(QLOGICPTI_REQ_QUEUE_LEN),
 			     qpti->req_cpu, qpti->req_dvma);
 #undef QSIZE
@@ -1394,10 +1395,10 @@
 	free_irq(qpti->irq, qpti);
 
 #define QSIZE(entries)	(((entries) + 1) * QUEUE_ENTRY_LEN)
-	sbus_free_consistent(qpti->sdev,
+	sbus_free_consistent(&qpti->sdev->ofdev.dev,
 			     QSIZE(RES_QUEUE_LEN),
 			     qpti->res_cpu, qpti->res_dvma);
-	sbus_free_consistent(qpti->sdev,
+	sbus_free_consistent(&qpti->sdev->ofdev.dev,
 			     QSIZE(QLOGICPTI_REQ_QUEUE_LEN),
 			     qpti->req_cpu, qpti->req_dvma);
 #undef QSIZE
diff --git a/drivers/scsi/sun_esp.c b/drivers/scsi/sun_esp.c
index d110b94..35b6e2c 100644
--- a/drivers/scsi/sun_esp.c
+++ b/drivers/scsi/sun_esp.c
@@ -101,7 +101,7 @@
 {
 	struct sbus_dev *sdev = esp->dev;
 
-	esp->command_block = sbus_alloc_consistent(sdev, 16,
+	esp->command_block = sbus_alloc_consistent(&sdev->ofdev.dev, 16,
 						   &esp->command_block_dma);
 	if (!esp->command_block)
 		return -ENOMEM;
@@ -223,25 +223,33 @@
 static dma_addr_t sbus_esp_map_single(struct esp *esp, void *buf,
 				      size_t sz, int dir)
 {
-	return sbus_map_single(esp->dev, buf, sz, dir);
+	struct sbus_dev *sdev = esp->dev;
+
+	return sbus_map_single(&sdev->ofdev.dev, buf, sz, dir);
 }
 
 static int sbus_esp_map_sg(struct esp *esp, struct scatterlist *sg,
 				  int num_sg, int dir)
 {
-	return sbus_map_sg(esp->dev, sg, num_sg, dir);
+	struct sbus_dev *sdev = esp->dev;
+
+	return sbus_map_sg(&sdev->ofdev.dev, sg, num_sg, dir);
 }
 
 static void sbus_esp_unmap_single(struct esp *esp, dma_addr_t addr,
 				  size_t sz, int dir)
 {
-	sbus_unmap_single(esp->dev, addr, sz, dir);
+	struct sbus_dev *sdev = esp->dev;
+
+	sbus_unmap_single(&sdev->ofdev.dev, addr, sz, dir);
 }
 
 static void sbus_esp_unmap_sg(struct esp *esp, struct scatterlist *sg,
 			      int num_sg, int dir)
 {
-	sbus_unmap_sg(esp->dev, sg, num_sg, dir);
+	struct sbus_dev *sdev = esp->dev;
+
+	sbus_unmap_sg(&sdev->ofdev.dev, sg, num_sg, dir);
 }
 
 static int sbus_esp_irq_pending(struct esp *esp)
@@ -550,7 +558,7 @@
 fail_free_irq:
 	free_irq(host->irq, esp);
 fail_unmap_command_block:
-	sbus_free_consistent(esp->dev, 16,
+	sbus_free_consistent(&esp_dev->ofdev.dev, 16,
 			     esp->command_block,
 			     esp->command_block_dma);
 fail_unmap_regs:
@@ -589,6 +597,7 @@
 static int __devexit esp_sbus_remove(struct of_device *dev)
 {
 	struct esp *esp = dev_get_drvdata(&dev->dev);
+	struct sbus_dev *sdev = esp->dev;
 	struct of_device *dma_of = esp->dma;
 	unsigned int irq = esp->host->irq;
 	u32 val;
@@ -600,7 +609,7 @@
 	dma_write32(val & ~DMA_INT_ENAB, DMA_CSR);
 
 	free_irq(irq, esp);
-	sbus_free_consistent(esp->dev, 16,
+	sbus_free_consistent(&sdev->ofdev.dev, 16,
 			     esp->command_block,
 			     esp->command_block_dma);
 	sbus_iounmap(esp->regs, SBUS_ESP_REG_SIZE);