patch-2.4.13 linux/arch/arm/mach-sa1100/sa1111-pcibuf.c

Next file: linux/arch/arm/mach-sa1100/sa1111.c
Previous file: linux/arch/arm/mach-sa1100/pfs168.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.12/linux/arch/arm/mach-sa1100/sa1111-pcibuf.c linux/arch/arm/mach-sa1100/sa1111-pcibuf.c
@@ -13,7 +13,6 @@
  *
  *  06/13/2001 - created.
  */
-
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -64,13 +63,6 @@
 	return 0;
 }
 
-static void
-free_safe_buffers(void)
-{
-	pci_pool_destroy(small_buffer_cache);
-	pci_pool_destroy(large_buffer_cache);
-}
-
 /* allocate a 'safe' buffer and keep track of it */
 static char *
 alloc_safe_buffer(char *unsafe, int size, dma_addr_t *pbus)
@@ -183,17 +175,11 @@
  * we assume calls to map_single are symmetric with calls to unmap_single...
  */
 dma_addr_t
-pci_map_single(struct pci_dev *hwdev, void *virtptr,
+sa1111_map_single(struct pci_dev *hwdev, void *virtptr,
 	       size_t size, int direction)
 {
 	dma_addr_t busptr;
 
-	/* hack; usb-ohci.c never sends hwdev==NULL, all others do */
-	if (hwdev == NULL) {
-		consistent_sync(virtptr, size, direction);
-		return virt_to_bus(virtptr);
-	}
-
 	mapped_alloc_size += size;
 
 	if (0) printk("pci_map_single(hwdev=%p,ptr=%p,size=%d,dir=%x) "
@@ -235,7 +221,7 @@
  * (basically return things back to the way they should be)
  */
 void
-pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
+sa1111_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
 		 size_t size, int direction)
 {
 	char *safe, *unsafe;
@@ -267,13 +253,21 @@
 	}
 }
 
-EXPORT_SYMBOL(pci_map_single);
-EXPORT_SYMBOL(pci_unmap_single);
+EXPORT_SYMBOL(sa1111_map_single);
+EXPORT_SYMBOL(sa1111_unmap_single);
 
-static void __init sa1111_init_safe_buffers(void)
+static int __init sa1111_init_safe_buffers(void)
 {
 	printk("Initializing SA1111 buffer pool for DMA workaround\n");
 	init_safe_buffers(NULL);
+	return 0;
+}
+
+static void free_safe_buffers(void)
+{
+	pci_pool_destroy(small_buffer_cache);
+	pci_pool_destroy(large_buffer_cache);
 }
 
-__initcall(sa1111_init_safe_buffers);
+module_init(sa1111_init_safe_buffers);
+module_exit(free_safe_buffers);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)