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

From: Marcelo Tosatti <[email-masked]>
Date: Thu, 28 Jul 2005 06:14:39 -0300

From: Aristeu Sergio Rozanski Filho <[email-masked]>

8xx: using dma_alloc_coherent() instead consistent_alloc()

Signed-off-by: Aristeu Sergio Rozanski Filho <[email-masked]>
Signed-off-by: Marcelo Tosatti <[email-masked]>

Index: 2.6-8xx/arch/ppc/8xx_io/fec.c
===================================================================
--- 2.6-8xx.orig/arch/ppc/8xx_io/fec.c	2005-07-04 11:45:57.000000000 -0300
+++ 2.6-8xx/arch/ppc/8xx_io/fec.c	2005-07-04 11:45:58.000000000 -0300
@@ -1580,7 +1580,7 @@
 	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;
@@ -1645,7 +1645,8 @@
 		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.
 	*/
@@ -1662,7 +1663,10 @@
 
 		/* 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.