aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sun_esp.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-08-27 21:37:58 -0400
committerDavid S. Miller <davem@davemloft.net>2008-08-29 05:13:12 -0400
commit7a715f46012f3552294154978aed59cba9804928 (patch)
tree9e7079ae4ad370b63ac6c8a4face573d6cf60533 /drivers/scsi/sun_esp.c
parent5778002874de0fb7e3d8c4a0a4afb6b1a6297069 (diff)
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>
Diffstat (limited to 'drivers/scsi/sun_esp.c')
-rw-r--r--drivers/scsi/sun_esp.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/scsi/sun_esp.c b/drivers/scsi/sun_esp.c
index d110b94f111..35b6e2ccc39 100644
--- a/drivers/scsi/sun_esp.c
+++ b/drivers/scsi/sun_esp.c
@@ -101,7 +101,7 @@ static int __devinit esp_sbus_map_command_block(struct esp *esp)
101{ 101{
102 struct sbus_dev *sdev = esp->dev; 102 struct sbus_dev *sdev = esp->dev;
103 103
104 esp->command_block = sbus_alloc_consistent(sdev, 16, 104 esp->command_block = sbus_alloc_consistent(&sdev->ofdev.dev, 16,
105 &esp->command_block_dma); 105 &esp->command_block_dma);
106 if (!esp->command_block) 106 if (!esp->command_block)
107 return -ENOMEM; 107 return -ENOMEM;
@@ -223,25 +223,33 @@ static u8 sbus_esp_read8(struct esp *esp, unsigned long reg)
223static dma_addr_t sbus_esp_map_single(struct esp *esp, void *buf, 223static dma_addr_t sbus_esp_map_single(struct esp *esp, void *buf,
224 size_t sz, int dir) 224 size_t sz, int dir)
225{ 225{
226 return sbus_map_single(esp->dev, buf, sz, dir); 226 struct sbus_dev *sdev = esp->dev;
227
228 return sbus_map_single(&sdev->ofdev.dev, buf, sz, dir);
227} 229}
228 230
229static int sbus_esp_map_sg(struct esp *esp, struct scatterlist *sg, 231static int sbus_esp_map_sg(struct esp *esp, struct scatterlist *sg,
230 int num_sg, int dir) 232 int num_sg, int dir)
231{ 233{
232 return sbus_map_sg(esp->dev, sg, num_sg, dir); 234 struct sbus_dev *sdev = esp->dev;
235
236 return sbus_map_sg(&sdev->ofdev.dev, sg, num_sg, dir);
233} 237}
234 238
235static void sbus_esp_unmap_single(struct esp *esp, dma_addr_t addr, 239static void sbus_esp_unmap_single(struct esp *esp, dma_addr_t addr,
236 size_t sz, int dir) 240 size_t sz, int dir)
237{ 241{
238 sbus_unmap_single(esp->dev, addr, sz, dir); 242 struct sbus_dev *sdev = esp->dev;
243
244 sbus_unmap_single(&sdev->ofdev.dev, addr, sz, dir);
239} 245}
240 246
241static void sbus_esp_unmap_sg(struct esp *esp, struct scatterlist *sg, 247static void sbus_esp_unmap_sg(struct esp *esp, struct scatterlist *sg,
242 int num_sg, int dir) 248 int num_sg, int dir)
243{ 249{
244 sbus_unmap_sg(esp->dev, sg, num_sg, dir); 250 struct sbus_dev *sdev = esp->dev;
251
252 sbus_unmap_sg(&sdev->ofdev.dev, sg, num_sg, dir);
245} 253}
246 254
247static int sbus_esp_irq_pending(struct esp *esp) 255static int sbus_esp_irq_pending(struct esp *esp)
@@ -550,7 +558,7 @@ static int __devinit esp_sbus_probe_one(struct device *dev,
550fail_free_irq: 558fail_free_irq:
551 free_irq(host->irq, esp); 559 free_irq(host->irq, esp);
552fail_unmap_command_block: 560fail_unmap_command_block:
553 sbus_free_consistent(esp->dev, 16, 561 sbus_free_consistent(&esp_dev->ofdev.dev, 16,
554 esp->command_block, 562 esp->command_block,
555 esp->command_block_dma); 563 esp->command_block_dma);
556fail_unmap_regs: 564fail_unmap_regs:
@@ -589,6 +597,7 @@ static int __devinit esp_sbus_probe(struct of_device *dev, const struct of_devic
589static int __devexit esp_sbus_remove(struct of_device *dev) 597static int __devexit esp_sbus_remove(struct of_device *dev)
590{ 598{
591 struct esp *esp = dev_get_drvdata(&dev->dev); 599 struct esp *esp = dev_get_drvdata(&dev->dev);
600 struct sbus_dev *sdev = esp->dev;
592 struct of_device *dma_of = esp->dma; 601 struct of_device *dma_of = esp->dma;
593 unsigned int irq = esp->host->irq; 602 unsigned int irq = esp->host->irq;
594 u32 val; 603 u32 val;
@@ -600,7 +609,7 @@ static int __devexit esp_sbus_remove(struct of_device *dev)
600 dma_write32(val & ~DMA_INT_ENAB, DMA_CSR); 609 dma_write32(val & ~DMA_INT_ENAB, DMA_CSR);
601 610
602 free_irq(irq, esp); 611 free_irq(irq, esp);
603 sbus_free_consistent(esp->dev, 16, 612 sbus_free_consistent(&sdev->ofdev.dev, 16,
604 esp->command_block, 613 esp->command_block,
605 esp->command_block_dma); 614 esp->command_block_dma);
606 sbus_iounmap(esp->regs, SBUS_ESP_REG_SIZE); 615 sbus_iounmap(esp->regs, SBUS_ESP_REG_SIZE);