commit 1cb0e4339ecd39c62840c74b53546bd28c1ea1a9
Author: Alan Cox <alan@linux.intel.com>
Date: Tue May 4 20:38:47 2010 +0100
rar: perform a clean up pass
- Move to a registration model where each RAR is claimed/unclaimed
- Use that to fix the client stuff (one client per RAR so no need to queue stuff)
- Support unregister so drivers can rmmod themselves safely
- Fix locking hang on calling rar lock from rar callback
- Clean up
- Kerneldoc
Folded in the memrar update as Greg asked
- Fix various unload related bugs
- Use the per RAR allocator/deallocator
- Add kerneldoc
Signed-off-by: Alan Cox <alan@linux.intel.com>
diff --git a/drivers/staging/memrar/memrar_handler.c b/drivers/staging/memrar/memrar_handler.c
index 4bbf66f..281d8d7 100644
--- a/drivers/staging/memrar/memrar_handler.c
+++ b/drivers/staging/memrar/memrar_handler.c
@@ -114,6 +114,7 @@ struct memrar_rar_info {
struct memrar_allocator *allocator;
struct memrar_buffer_info buffers;
struct mutex lock;
+ int allocated; /* True if we own this RAR */
};
/*
@@ -150,11 +151,13 @@ static struct memrar_rar_info *memrar_get_rar_info(u32 vaddr)
return NULL;
}
-/*
- * Retrieve bus address from given handle.
+/**
+ * memrar_get_bus address - handle to bus address
+ *
+ * Retrieve bus address from given handle.
*
- * Returns address corresponding to given handle. Zero if handle is
- * invalid.
+ * Returns address corresponding to given handle. Zero if handle is
+ * invalid.
*/
static dma_addr_t memrar_get_bus_address(
struct memrar_rar_info *rar,
@@ -176,11 +179,13 @@ static dma_addr_t memrar_get_bus_address(
return rar->base + (vaddr - iobase);
}
-/*
- * Retrieve physical address from given handle.
+/**
+ * memrar_get_physical_address - handle to physical address
+ *
+ * Retrieve physical address from given handle.
*
- * Returns address corresponding to given handle. Zero if handle is
- * ...