aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sun_esp.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-08-27 21:09:11 -0400
committerDavid S. Miller <davem@davemloft.net>2008-08-29 05:13:15 -0400
commit738f2b7b813913e651f39387d007dd961755dee2 (patch)
tree022ca4d144cba51495e6f26a8f55d3046d16c2e3 /drivers/scsi/sun_esp.c
parent944c67dff7a88f0a775e5b604937f9e30d2de555 (diff)
sparc: Convert all SBUS drivers to dma_*() interfaces.
And all the SBUS dma interfaces are deleted. A private implementation remains inside of the 32-bit sparc port which exists only for the sake of the implementation of 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.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/scsi/sun_esp.c b/drivers/scsi/sun_esp.c
index 35b6e2ccc394..f7508743f705 100644
--- a/drivers/scsi/sun_esp.c
+++ b/drivers/scsi/sun_esp.c
@@ -9,6 +9,7 @@
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/mm.h> 10#include <linux/mm.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/dma-mapping.h>
12 13
13#include <asm/irq.h> 14#include <asm/irq.h>
14#include <asm/io.h> 15#include <asm/io.h>
@@ -101,8 +102,9 @@ static int __devinit esp_sbus_map_command_block(struct esp *esp)
101{ 102{
102 struct sbus_dev *sdev = esp->dev; 103 struct sbus_dev *sdev = esp->dev;
103 104
104 esp->command_block = sbus_alloc_consistent(&sdev->ofdev.dev, 16, 105 esp->command_block = dma_alloc_coherent(&sdev->ofdev.dev, 16,
105 &esp->command_block_dma); 106 &esp->command_block_dma,
107 GFP_ATOMIC);
106 if (!esp->command_block) 108 if (!esp->command_block)
107 return -ENOMEM; 109 return -ENOMEM;
108 return 0; 110 return 0;
@@ -225,7 +227,7 @@ static dma_addr_t sbus_esp_map_single(struct esp *esp, void *buf,
225{ 227{
226 struct sbus_dev *sdev = esp->dev; 228 struct sbus_dev *sdev = esp->dev;
227 229
228 return sbus_map_single(&sdev->ofdev.dev, buf, sz, dir); 230 return dma_map_single(&sdev->ofdev.dev, buf, sz, dir);
229} 231}
230 232
231static int sbus_esp_map_sg(struct esp *esp, struct scatterlist *sg, 233static int sbus_esp_map_sg(struct esp *esp, struct scatterlist *sg,
@@ -233,7 +235,7 @@ static int sbus_esp_map_sg(struct esp *esp, struct scatterlist *sg,
233{ 235{
234 struct sbus_dev *sdev = esp->dev; 236 struct sbus_dev *sdev = esp->dev;
235 237
236 return sbus_map_sg(&sdev->ofdev.dev, sg, num_sg, dir); 238 return dma_map_sg(&sdev->ofdev.dev, sg, num_sg, dir);
237} 239}
238 240
239static void sbus_esp_unmap_single(struct esp *esp, dma_addr_t addr, 241static void sbus_esp_unmap_single(struct esp *esp, dma_addr_t addr,
@@ -241,7 +243,7 @@ static void sbus_esp_unmap_single(struct esp *esp, dma_addr_t addr,
241{ 243{
242 struct sbus_dev *sdev = esp->dev; 244 struct sbus_dev *sdev = esp->dev;
243 245
244 sbus_unmap_single(&sdev->ofdev.dev, addr, sz, dir); 246 dma_unmap_single(&sdev->ofdev.dev, addr, sz, dir);
245} 247}
246 248
247static void sbus_esp_unmap_sg(struct esp *esp, struct scatterlist *sg, 249static void sbus_esp_unmap_sg(struct esp *esp, struct scatterlist *sg,
@@ -249,7 +251,7 @@ static void sbus_esp_unmap_sg(struct esp *esp, struct scatterlist *sg,
249{ 251{
250 struct sbus_dev *sdev = esp->dev; 252 struct sbus_dev *sdev = esp->dev;
251 253
252 sbus_unmap_sg(&sdev->ofdev.dev, sg, num_sg, dir); 254 dma_unmap_sg(&sdev->ofdev.dev, sg, num_sg, dir);
253} 255}
254 256
255static int sbus_esp_irq_pending(struct esp *esp) 257static int sbus_esp_irq_pending(struct esp *esp)
@@ -558,9 +560,9 @@ static int __devinit esp_sbus_probe_one(struct device *dev,
558fail_free_irq: 560fail_free_irq:
559 free_irq(host->irq, esp); 561 free_irq(host->irq, esp);
560fail_unmap_command_block: 562fail_unmap_command_block:
561 sbus_free_consistent(&esp_dev->ofdev.dev, 16, 563 dma_free_coherent(&esp_dev->ofdev.dev, 16,
562 esp->command_block, 564 esp->command_block,
563 esp->command_block_dma); 565 esp->command_block_dma);
564fail_unmap_regs: 566fail_unmap_regs:
565 sbus_iounmap(esp->regs, SBUS_ESP_REG_SIZE); 567 sbus_iounmap(esp->regs, SBUS_ESP_REG_SIZE);
566fail_unlink: 568fail_unlink:
@@ -609,9 +611,9 @@ static int __devexit esp_sbus_remove(struct of_device *dev)
609 dma_write32(val & ~DMA_INT_ENAB, DMA_CSR); 611 dma_write32(val & ~DMA_INT_ENAB, DMA_CSR);
610 612
611 free_irq(irq, esp); 613 free_irq(irq, esp);
612 sbus_free_consistent(&sdev->ofdev.dev, 16, 614 dma_free_coherent(&sdev->ofdev.dev, 16,
613 esp->command_block, 615 esp->command_block,
614 esp->command_block_dma); 616 esp->command_block_dma);
615 sbus_iounmap(esp->regs, SBUS_ESP_REG_SIZE); 617 sbus_iounmap(esp->regs, SBUS_ESP_REG_SIZE);
616 of_iounmap(&dma_of->resource[0], esp->dma_regs, 618 of_iounmap(&dma_of->resource[0], esp->dma_regs,
617 resource_size(&dma_of->resource[0])); 619 resource_size(&dma_of->resource[0]));