summaryrefslogtreecommitdiffstats
path: root/drivers/net/sunqe.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-08-28 03:09:11 +0200
committerDavid S. Miller <davem@davemloft.net>2008-08-29 11:13:15 +0200
commit738f2b7b813913e651f39387d007dd961755dee2 (patch)
tree022ca4d144cba51495e6f26a8f55d3046d16c2e3 /drivers/net/sunqe.c
parentsparc32: Implement more generic dma_*() interfaces. (diff)
downloadlinux-738f2b7b813913e651f39387d007dd961755dee2.tar.xz
linux-738f2b7b813913e651f39387d007dd961755dee2.zip
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/net/sunqe.c')
-rw-r--r--drivers/net/sunqe.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c
index ac8049cab247..66f66ee8ca63 100644
--- a/drivers/net/sunqe.c
+++ b/drivers/net/sunqe.c
@@ -24,6 +24,7 @@
#include <linux/skbuff.h>
#include <linux/ethtool.h>
#include <linux/bitops.h>
+#include <linux/dma-mapping.h>
#include <asm/system.h>
#include <asm/io.h>
@@ -879,12 +880,12 @@ static int __devinit qec_ether_init(struct sbus_dev *sdev)
goto fail;
}
- qe->qe_block = sbus_alloc_consistent(&qe->qe_sdev->ofdev.dev,
- PAGE_SIZE,
- &qe->qblock_dvma);
- qe->buffers = sbus_alloc_consistent(&qe->qe_sdev->ofdev.dev,
- sizeof(struct sunqe_buffers),
- &qe->buffers_dvma);
+ qe->qe_block = dma_alloc_coherent(&qe->qe_sdev->ofdev.dev,
+ PAGE_SIZE,
+ &qe->qblock_dvma, GFP_ATOMIC);
+ qe->buffers = dma_alloc_coherent(&qe->qe_sdev->ofdev.dev,
+ sizeof(struct sunqe_buffers),
+ &qe->buffers_dvma, GFP_ATOMIC);
if (qe->qe_block == NULL || qe->qblock_dvma == 0 ||
qe->buffers == NULL || qe->buffers_dvma == 0)
goto fail;
@@ -926,15 +927,15 @@ fail:
if (qe->mregs)
sbus_iounmap(qe->mregs, MREGS_REG_SIZE);
if (qe->qe_block)
- sbus_free_consistent(&qe->qe_sdev->ofdev.dev,
- PAGE_SIZE,
- qe->qe_block,
- qe->qblock_dvma);
+ dma_free_coherent(&qe->qe_sdev->ofdev.dev,
+ PAGE_SIZE,
+ qe->qe_block,
+ qe->qblock_dvma);
if (qe->buffers)
- sbus_free_consistent(&qe->qe_sdev->ofdev.dev,
- sizeof(struct sunqe_buffers),
- qe->buffers,
- qe->buffers_dvma);
+ dma_free_coherent(&qe->qe_sdev->ofdev.dev,
+ sizeof(struct sunqe_buffers),
+ qe->buffers,
+ qe->buffers_dvma);
free_netdev(dev);
@@ -957,14 +958,14 @@ static int __devexit qec_sbus_remove(struct of_device *dev)
sbus_iounmap(qp->qcregs, CREG_REG_SIZE);
sbus_iounmap(qp->mregs, MREGS_REG_SIZE);
- sbus_free_consistent(&qp->qe_sdev->ofdev.dev,
- PAGE_SIZE,
- qp->qe_block,
- qp->qblock_dvma);
- sbus_free_consistent(&qp->qe_sdev->ofdev.dev,
- sizeof(struct sunqe_buffers),
- qp->buffers,
- qp->buffers_dvma);
+ dma_free_coherent(&qp->qe_sdev->ofdev.dev,
+ PAGE_SIZE,
+ qp->qe_block,
+ qp->qblock_dvma);
+ dma_free_coherent(&qp->qe_sdev->ofdev.dev,
+ sizeof(struct sunqe_buffers),
+ qp->buffers,
+ qp->buffers_dvma);
free_netdev(net_dev);