projects/linux·commit fc007ddd

[PATCH] ppc32: 8xx: using dma_alloc_coherent() instead consistent_alloc()

fc007ddd · Aristeu Sergio Rozanski Filho <[email protected]> · 2005-08-07 09:42:33 -07:00

8xx: using dma_alloc_coherent() instead consistent_alloc()

Signed-off-by: Aristeu Sergio Rozanski Filho <[email protected]>
Signed-off-by: Marcelo Tosatti <[email protected]>
Cc: Jeff Garzik <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
fc007ddd609ccfce1cd392e65eed05aba8db32ce
Parents
8b0ed2fb

Changes

1 files changed · +7 −3

FileStatusAddDelContent
arch/ppc/8xx_io/fec.cmodified+7−3View file

arch/ppc/8xx_io/fec.c

View file
diff --git a/arch/ppc/8xx_io/fec.c b/arch/ppc/8xx_io/fec.c
index 33ff297..8a9a76c 100644
--- a/arch/ppc/8xx_io/fec.c
+++ b/arch/ppc/8xx_io/fec.c
@@ -1575,7 +1575,7 @@ static int __init fec_enet_init(void)
struct fec_enet_private *fep;
int i, j, k, err;
unsigned char *eap, *iap, *ba;
- unsigned long mem_addr;
+ dma_addr_t mem_addr;
volatile cbd_t *bdp;
cbd_t *cbd_base;
volatile immap_t *immap;
@@ -1640,7 +1640,8 @@ static int __init fec_enet_init(void)
printk("FEC initialization failed.\n");
return 1;
}
- cbd_base = (cbd_t *)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &mem_addr);
+ cbd_base = (cbd_t *)dma_alloc_coherent(dev->class_dev.dev, PAGE_SIZE,
+ &mem_addr, GFP_KERNEL);
/* Set receive and transmit descriptor base.
*/
@@ -1657,7 +1658,10 @@ static int __init fec_enet_init(void)
/* Allocate a page.
*/
- ba = (unsigned char *)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &mem_addr);
+ ba = (unsigned char *)dma_alloc_coherent(dev->class_dev.dev,
+ PAGE_SIZE,
+ &mem_addr,
+ GFP_KERNEL);
/* BUG: no check for failure */
/* Initialize the BD for every fragment in the page.