Skip to contentSkip to conversation

8xx: using dma_alloc_coherent() instead consistent_alloc()

PATCH New Marcelo Tosatti 1 participant 1 message Jul 28, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 8xx: using dma_alloc_coherent() instead consistent_alloc()

From: Aristeu Sergio Rozanski Filho <[email protected]>

8xx: using dma_alloc_coherent() instead consistent_alloc()

arch/ppc/8xx_io/fec.c +7 -3
Index: 2.6-8xx/arch/ppc/8xx_io/fec.c
===================================================================
@@ -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.