login
Header Space

 
 

[PATCH 2/7] Alchemy: dbdma: add api to delete custom ddma devices

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-mips@...>, <linux-kernel@...>
Date: Wednesday, May 7, 2008 - 12:03 pm

From 54c63c0bbf48673e5550b62d3ca4272dd0a1bedf Mon Sep 17 00:00:00 2001
From: Manuel Lauss <mlau@msc-ge.com>
Date: Wed, 7 May 2008 13:45:23 +0200
Subject: [PATCH] Alchemy: dbdma: add API to delete custom DDMA device ids.

Add API to delete custom DDMA device ids created with
au1xxx_ddma_device_add(), to avoid filling the ddma id table by repeatedly
loading/unloading a module using this function.

Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
---
 arch/mips/au1000/common/dbdma.c             |   10 ++++++++++
 include/asm-mips/mach-au1x00/au1xxx_dbdma.h |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/mips/au1000/common/dbdma.c b/arch/mips/au1000/common/dbdma.c
index 53377df..69171c6 100644
--- a/arch/mips/au1000/common/dbdma.c
+++ b/arch/mips/au1000/common/dbdma.c
@@ -220,6 +220,16 @@ au1xxx_ddma_add_device(dbdev_tab_t *dev)
 }
 EXPORT_SYMBOL(au1xxx_ddma_add_device);
 
+void au1xxx_ddma_del_device(u32 devid)
+{
+	dbdev_tab_t *p = find_dbdev_id(devid);
+	if (p != NULL) {
+		memset(p, 0, sizeof(dbdev_tab_t));
+		p->dev_id = ~0;
+	}
+}
+EXPORT_SYMBOL(au1xxx_ddma_del_device);
+
 /* Allocate a channel and return a non-zero descriptor if successful.
 */
 u32
diff --git a/include/asm-mips/mach-au1x00/au1xxx_dbdma.h b/include/asm-mips/mach-au1x00/au1xxx_dbdma.h
index 93d507c..5e33ff0 100644
--- a/include/asm-mips/mach-au1x00/au1xxx_dbdma.h
+++ b/include/asm-mips/mach-au1x00/au1xxx_dbdma.h
@@ -367,6 +367,7 @@ void au1xxx_dbdma_dump(u32 chanid);
 u32 au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr );
 
 u32 au1xxx_ddma_add_device( dbdev_tab_t *dev );
+void au1xxx_ddma_del_device(u32 devid);
 void * au1xxx_ddma_get_nextptr_virt(au1x_ddma_desc_t *dp);
 
 /*
-- 
1.5.5.1

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/7] au1xmmc updates, Manuel Lauss, (Wed May 7, 12:01 pm)
[PATCH 2/7] Alchemy: dbdma: add api to delete custom ddma de..., Manuel Lauss, (Wed May 7, 12:03 pm)
[PATCH 7/7] au1xmmc: codingstyle tidying, Manuel Lauss, (Wed May 7, 12:09 pm)
[PATCH 6/7] au1xmmc: wire up SDIO interrupt, Manuel Lauss, (Wed May 7, 12:08 pm)
[PATCH 5/7] au1xmmc: 4 bit transfer mode, Manuel Lauss, (Wed May 7, 12:07 pm)
speck-geostationary