diff options
author | David S. Miller <davem@davemloft.net> | 2008-08-27 21:09:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-08-29 05:13:15 -0400 |
commit | 738f2b7b813913e651f39387d007dd961755dee2 (patch) | |
tree | 022ca4d144cba51495e6f26a8f55d3046d16c2e3 /drivers/scsi/sun_esp.c | |
parent | 944c67dff7a88f0a775e5b604937f9e30d2de555 (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.c | 26 |
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 | ||
231 | static int sbus_esp_map_sg(struct esp *esp, struct scatterlist *sg, | 233 | static 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 | ||
239 | static void sbus_esp_unmap_single(struct esp *esp, dma_addr_t addr, | 241 | static 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 | ||
247 | static void sbus_esp_unmap_sg(struct esp *esp, struct scatterlist *sg, | 249 | static 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 | ||
255 | static int sbus_esp_irq_pending(struct esp *esp) | 257 | static int sbus_esp_irq_pending(struct esp *esp) |
@@ -558,9 +560,9 @@ static int __devinit esp_sbus_probe_one(struct device *dev, | |||
558 | fail_free_irq: | 560 | fail_free_irq: |
559 | free_irq(host->irq, esp); | 561 | free_irq(host->irq, esp); |
560 | fail_unmap_command_block: | 562 | fail_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); |
564 | fail_unmap_regs: | 566 | fail_unmap_regs: |
565 | sbus_iounmap(esp->regs, SBUS_ESP_REG_SIZE); | 567 | sbus_iounmap(esp->regs, SBUS_ESP_REG_SIZE); |
566 | fail_unlink: | 568 | fail_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])); |